Add new test to find first unique Character

This commit is contained in:
YuCheng Hu 2021-04-22 08:58:31 -04:00
parent 3404acc543
commit 6baa2c473f
No known key found for this signature in database
GPG Key ID: C395DC68EF030B59
2 changed files with 60 additions and 1 deletions

View File

@ -0,0 +1,59 @@
package com.ossez.toolkits.codebank.tests.leetcode;
import com.ossez.toolkits.codebank.common.model.TreeNode;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
/**
* <p>
* 7
* <ul>
* <li>@see <a href=
* "https://www.cwiki.us/display/ITCLASSIFICATION/Serialize+and+Deserialize+Binary+Tree">https://www.cwiki.us/display/ITCLASSIFICATION/Serialize+and+Deserialize+Binary+Tree</a>
* <li>@see<a href=
* "https://leetcode.com/problems/first-unique-character-in-a-string/">https://leetcode.com/problems/first-unique-character-in-a-string/</a>
* </ul>
* </p>
*
* @author YuCheng
*
*/
public class LeetCode0387FirstUniqueCharacterTest {
private final static Logger logger = LoggerFactory.getLogger(LeetCode0387FirstUniqueCharacterTest.class);
/**
*
*/
@Test
public void testMain() {
logger.debug("BEGIN");
String data = "leetcode";
System.out.println(firstUniqChar(data));
}
/**
* Deserialize from array to tree
*
* @param data
* @return
*/
private int firstUniqChar(String data) {
// NULL CHECK
if (data.equals("")) {
return -1;
}
return 0;
}
}

View File

@ -6,7 +6,7 @@
</Console>
</Appenders>
<Loggers>
<Logger name="com.insight.sco" level="trace">
<Logger name="com.ossez" level="trace">
<AppenderRef ref="Console"/>
</Logger>
<Root level="error">