Day 10: Coding Challenge

Day 10: Coding Challenge

Problem - Given an array of integers citations where citations[i] is the number of citations a researcher received for their ith paper, return the researcher's h-index.

According to the definition of h-index on Wikipedia: The h-index is defined as the maximum value of h such that the given researcher has published at least h papers that have each been cited at least h times.

Solutions - First, we will sort the array in decreasing order then we will check the last position in which citations[i]>=i+1 and return the index.


Time complexity : O(NLogN)

Space complexity : O(1)


#Codingchallenge #problemsolvingskills #problemsolving #codeforgood #60daysofchallenge #60dayscode #consistency #dsaforproblemsolving

To view or add a comment, sign in

More articles by Shraddha M Thakur

  • Day 14: Coding Challenge

    Day 14: Coding Challenge

    Problem - Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10…

  • Day 13: Coding Challenge

    Day 13: Coding Challenge

    Problem - There are n children standing in a line. Each child is assigned a rating value given in the integer array…

  • Day 12: Coding Challenge

    Day 12: Coding Challenge

    Problem - There are n gas stations along a circular route, where the amount of gas at the ith station is gas[i]. You…

  • Day 11: Coding Challenge

    Day 11: Coding Challenge

    Problem - Given an integer array nums, return an array answer such that answer[i] is equal to the product of all the…

  • Day 9: Coding Challenge

    Day 9: Coding Challenge

    Problem - You are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0].

  • Day 8: Coding Challenge

    Day 8: Coding Challenge

    Problem - You are given an integer array of nums. You are initially positioned at the array's first index, and each…

  • Day 7: Coding Challenge

    Day 7: Coding Challenge

    Problem - You are given an integer array of prices where prices[i] is the price of a given stock on the ith day. On…

  • Day 6: Coding Challenge

    Day 6: Coding Challenge

    Problem - You are given an array of prices where prices[i] is the price of a given stock on the ith day. You want to…

  • Day 5: Coding Challenge

    Day 5: Coding Challenge

    Problem - Given an integer array , rotate the array to the right by steps, where is non-negative. Solution - This is a…

  • Day 4: Coding Challenge

    Day 4: Coding Challenge

    Problem - Given an integer array nums sorted in non-decreasing order, remove some duplicates in place such that each…

Insights from the community

Others also viewed

Explore topics