Posts

Showing posts from November, 2022

HackerRank problem solution

Image
  1. Lonely Integer problem  In this  HackerRank Lonely Integer problem solution,  we have Given an array of integers, where all elements but one occur twice, find the unique element. Problem solution in Python def  lonelyinteger(a):      for  x  in  a:         ax = a.count(x)          if  ax ==  1 :              return  x   2. Grading Student problem Problem solution in Python           def  gradingStudents(grades):           for  x  in  grades:         dif = (( int (x/ 5 )* 5 )+ 5 )-x          if   dif< 3   and  x> 37 :      ...