[DP & 문자열] Longest Palindromic Substring

716 단어 LeetCode
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring.
DP, d[i][j]를 사용하여 문자열 i-j가 회문인지 여부를 나타냅니다.
public class Solution {
    public String longestPalindrome(String s) {
        int max = 0;
        int len = s.length();
        int maxL = 0;
        int maxR = 0;
        for(int i=0; i=0 && r=0 && r

좋은 웹페이지 즐겨찾기