Skip to content

Instantly share code, notes, and snippets.

@Desolve
Created January 30, 2020 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Desolve/05c2e5731e195ddd44754fd326e3e8cc to your computer and use it in GitHub Desktop.
Save Desolve/05c2e5731e195ddd44754fd326e3e8cc to your computer and use it in GitHub Desktop.
1332 Remove Palindromic Subsequences
class Solution {
public int removePalindromeSub(String s) {
if (s.isEmpty()) return 0;
if (s.equals(new StringBuilder(s).reverse().toString())) return 1;
else return 2;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment