博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Palindrome Partitioning
阅读量:4075 次
发布时间:2019-05-25

本文共 713 字,大约阅读时间需要 2 分钟。

Palindrome Partitioning

Given a string s, partition s such that every substring of the partition is a palindrome.

Return all possible palindrome partitioning of s.

For example, given s = "aab",
Return

[    ["aa","b"],    ["a","a","b"]  ]

解题分析:

Java代码:

public class Solution {   List
> resultLst; ArrayList
currLst; public List
> partition(String s) { resultLst = new ArrayList
>(); currLst = new ArrayList
(); backTrack(s,0); return resultLst; } public void backTrack(String s, int l){ if(currLst.size()>0 //the initial str could be palindrome && l>=s.length()){ List
r = (ArrayList
) currLst.clone(); resultLst.add(r); } for(int i=l;i

转载地址:http://kpuni.baihongyu.com/

你可能感兴趣的文章
Holographic Remoting Player
查看>>
unity之LOD
查看>>
UNITY 移动到指定位置的写法
查看>>
Unity中关于作用力方式ForceMode的功能注解
查看>>
UNITY实现FLASH中的setTimeout
查看>>
HOLOLENS 扫描特效 及得出扫描结果(SurfacePlane)
查看>>
矩形旋转一定角度后,四个点的新坐标
查看>>
Unity - RectTransform详解
查看>>
UNITY和图片像素的换算
查看>>
Resources.Load加载文件返回null的原因
查看>>
Introducing Holographic Emulation
查看>>
新手!mass 设置问题
查看>>
AS3语法和UNITY C#语法的异同
查看>>
ACCELEROMETER
查看>>
在后台中高效工作 – 后台任务
查看>>
half extents
查看>>
Unity需要频繁登录是什么情况
查看>>
UNITY自带的PACKAGE的UTILITY 里面有一个自带的FPS COUNTER
查看>>
AssetBundle Manager & Example Scenes
查看>>
fixed数据类型
查看>>