Solution
మనం ఇప్పుడు చూస్తున్న ప్రపంచం మన ఆలోచనల్లోంచే పుట్టింది. ఈ ప్రపంచన్ని మార్చాలంటే మన ఆలోచనలను మార్చుకోవాలి. Coal and Diamond are both carbon, its just how the atoms are arranged makes difference. Our thoughts are also same, they make us, its in our hands ! Thought is LIFE !
Tuesday, May 12, 2020
Monday, May 11, 2020
Socks problem - Can you help me with better logic ?
Problem:
Solution:
static int sockMerchant(int n, int[] ar) {
int cnt=0;
Arrays.sort(ar);
for(int i=0;i<n-1;i++)
if(ar[i]==ar[i+1]){cnt++;i++;}
return cnt;
}
Subscribe to:
Posts (Atom)