oanaunciuleanu22 nov. 20221 min de cititWeighted Job Scheduling in JAVAYou receive a list of jobs that have three elements: start time, finish time and profit. You have to schedule the jobs with no...
oanaunciuleanu22 nov. 20221 min de cititTotal number of non-decreasing numbers with n digits in JAVAA non-decreasing number has every digit greater than or equal to the previous digit. Given the number of digits, find how many numbers...
oanaunciuleanu22 nov. 20221 min de cititTiling Problem in JAVAYou 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...
oanaunciuleanu22 nov. 20221 min de cititSubset Sum Problem in JAVAGiven 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...
oanaunciuleanu22 nov. 20221 min de cititShortest Common Supersequence in JAVAGiven two strings as input, the task is to find the length of the shortest string that has both strings as subsequences. Solution: 1. ...
oanaunciuleanu22 nov. 20221 min de cititPalindrome Partitioning in JAVAStarting from a string, we determine it’s a palindrome partitioning by diving it into substrings, each being a palindrome. In our problem...
oanaunciuleanu22 nov. 20222 min de cititMobile Numeric Keypad Problem in JAVAWe 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...