life is too short for a diary



Posts Tagged: java (Page 10)

Apply Discount To Prices leetcode solution

A sentence is a string of single-space separated words where each word can contain digits, lowercase letters, and the dollar sign '$'. A word represents a price if it is a sequence of digits preceded by a dollar sign...

Continue reading → leetcode java python string



Sort Characters By Frequency solution leetcode

Given a string s, sort it in decreasing order based on the frequency of the characters. The frequency of a character is the number of times it appears in the string...

Continue reading → leetcode java python heap



Minimum Consecutive Cards to Pick up solution leetcode

An interesting problem on leetcode to find minimum number of ways to pick up consecutive cards. We will start with a brute force algorithm that would exceed in time limit. Later we will improve upon this algorithm using hashmap...

Continue reading → leetcode java python hashmap