Convert a string representing a duration, ie: 300ms, 20s, etc to to nanoseconds

Suppose you have a string in your application that has the duration of time using ns, us ms , s h, d. And you want to convert them all to nano seconds, then utility will of great help to you.

Read More

Longest Palindromic Subsequence – Leetcode Java

Given a string s, find the longest palindromic subsequence’s length in s. You may assume that the maximum length of s is 1000. Example 1: Input:

Output:

One possible longest palindromic subsequence is “bbbb”. Example 2: Input:

Output:

One possible longest palindromic subsequence is “bb”. Java Solution

Read More