title: Binary search sort, Time out
body: <h1>Climbing the Leaderboard. Terminated due to timeout :(</h1>
  
  <p>A HackerRank challenge of algorithm category.</p>
  
  <hr>
  
  <p>My approach: To reduce the overhead when large arrays as input, I used map() and a Binar search function with it. No luck. I got 7/11 test cases passed. Can I ask for some help to improve my code. The code below is my solution so far. I need help to improve it. </p>
  
  <p><a href="https://i.stack.imgur.com/VrZLe.png" rel="nofollow noreferrer">Problem description</a></p>
  
  <pre><code>class Score_board:
      def climbingLeaderboard(self, scores, alice):
          self.boardScores = sorted(set(scores), reverse=True)
          alice_rank = list(map(self.rankBoard,alice))
          return alice_rank
  
      def rankBoard(self, current):
          score_bank = self.boardScores
          midIndex = len(score_bank)//2
          while midIndex &gt; 0:
              if current in score_bank:
                  return(self.boardScores.index(current)+1)
              elif current &lt; score_bank[midIndex]:
                  score_bank = score_bank[midIndex:]
                  midIndex = len(score_bank)//2
              elif current &gt; score_bank[midIndex]:
                  score_bank = score_bank[:midIndex]
                  midIndex = len(score_bank)//2
          else:
              boardIndex = self.boardScores.index(score_bank[0])
              if current in score_bank:
                  return(self.boardScores.index(current)+1)
              elif current &gt; score_bank[0] and boardIndex == 0:
                  return(1)
              elif current &lt; score_bank[0] and boardIndex == (len(self.boardScores)-1):
                  return(boardIndex + 2)
              elif current &gt; score_bank[0]:
                  return(boardIndex)
              elif current &lt; score_bank[0]:
                  return(boardIndex + 2)
  
  if __name__ == '__main__':
      scores_count = int(input())
      scores = list(map(int, input().rstrip().split()))
      alice_count = int(input())
      alice = list(map(int, input().rstrip().split()))
      coord = Score_board()
      result = coord.climbingLeaderboard(scores, alice)
      print('\n'.join(map(str, result)))
      print('\n')
  </code></pre>