Code Challenges

Get better at coding with practice problems.

Coding Challenges

Select a problem, write code, run test cases, and submit your solution.

Showing 19 of 355 problems

Implement the stoneGameOptimalDifference method that returns the best score difference when both players pick stones optimally. Solved

Implement the minimumCostCutStick method that returns the minimum total cost to cut a stick at given positions. Solved

Implement the lruCacheGetOutputSum method that simulates an LRU cache and returns the sum of get results. Solved

Implement the minStackFinalMinimum method that simulates stack operations and returns the final minimum value. Solved

Implement the evaluateRpnExpression method that evaluates an arithmetic expression written in Reverse Polish Notation. Solved

Implement the longestIncreasingPathMatrix method that returns the longest strictly increasing path length in a matrix. Solved

Implement the distinctSubsequenceCount method that counts how many subsequences of a source string equal a target string. Solved

Implement the interleavingStringCheck method that checks whether one string is formed by interleaving two other strings. Solved

Implement the minimumFlipsMonotoneBinary method that returns the minimum flips needed to make a binary string monotone increasing. Solved

Implement the shortestSubarrayAtLeastKLength method that returns the shortest subarray length with sum at least k. Solved

Implement the boundedMaximumSubarrayCount method that counts subarrays whose maximum value stays within a given range. Solved