Skip to content

Latest commit

 

History

History
42 lines (28 loc) · 1.63 KB

File metadata and controls

42 lines (28 loc) · 1.63 KB

Problem 1

Math Homework
Students have been assigned a series of math problems that have points associated with them. Given a sorted points array, minimize the number of problems a student needs to solve based on the criteria Lyte

  1. They must always solve the first problem, index /= 0.
  2. After solving the ith problem, they have a choice: solve the next problem (i + 1) or skip ahead and work the (i + 2) problem.
  3. Students must keep solving problems until the difference between the maximum points and the minimum points questions solved so far meets or exceeds a specified threshold.
  4. If the student cannot meet or exceed the threshold, they must work all the problems.

Return the minimum number of problems a student needs to solve.

Problem 2

Shortest Palindrome

A palindrome is defined as a word that reads the same forward as it does backward. For example, the as) * The function is expected to return an INTEGER. The word "tacocat" is a palindrome, but the words "taco" and "cat" are not.

Determine the minimum number of characters that must be inserted into a string to make it a palindrome.

For example, the string s = “abcda"can be made a palindrome by performing the sequence:

abcda -> abdcda -> abdcdba

So the answer of this test case is 2.


This file is created by Kiranpal Singh
For Data Structures and Algorithm snippets, click here

kiranpalsingh