oanaunciuleanu
22 nov. 20221 min de citit
Weighted Job Scheduling in JAVA
You receive a list of jobs that have three elements: start time, finish time and profit. You have to schedule the jobs with no...
5 afișări0 comentarii
oanaunciuleanu
22 nov. 20221 min de citit
Total number of non-decreasing numbers with n digits in JAVA
A non-decreasing number has every digit greater than or equal to the previous digit. Given the number of digits, find how many numbers...
6 afișări0 comentarii
oanaunciuleanu
22 nov. 20221 min de citit
Tiling Problem in JAVA
You can use a board that is 2 x n size. The tiles are of size 2 x 1. Count the number of ways to tile the board. Tiles can be placed...
6 afișări0 comentarii
oanaunciuleanu
22 nov. 20221 min de citit
Subset Sum Problem in JAVA
Given a set of non-negative integers, and a value sum, determine if there is a subset of the given set with the sum equal to the given...
7 afișări0 comentarii
oanaunciuleanu
22 nov. 20221 min de citit
Shortest Common Supersequence in JAVA
Given two strings as input, the task is to find the length of the shortest string that has both strings as subsequences. Solution: 1. ...
3 afișări0 comentarii
oanaunciuleanu
22 nov. 20221 min de citit
Palindrome Partitioning in JAVA
Starting from a string, we determine it’s a palindrome partitioning by diving it into substrings, each being a palindrome. In our problem...
4 afișări0 comentarii
oanaunciuleanu
22 nov. 20222 min de citit
Mobile Numeric Keypad Problem in JAVA
We use a mobile numeric keyboard. You can only press buttons that are up, left, right or down to the current button. You are not allowed...
2 afișări0 comentarii