This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public String[] wordBoggle(char board[][], String[] dictionary) | |
{ | |
Set<String> doableWords = new HashSet<String>(); | |
for (String word : dictionary) { | |
if (!doableWords.contains(word)) { | |
for (int i = 0; i < board.length; i++) { | |
for (int j = 0; j < board[0].length; j++) { | |
if (canMakeWord(i, j, word, 0, board)) { | |
doableWords.add(word); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public ListNode reverseList(ListNode head) { | |
ListNode prev = null; | |
ListNode current = head; | |
while(current != null) { | |
ListNode next = current.next; | |
current.next = prev; | |
prev = current; | |
current = next; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Definition for singly-linked list. | |
* public class ListNode { | |
* int val; | |
* ListNode next; | |
* ListNode() {} | |
* ListNode(int val) { this.val = val; } | |
* ListNode(int val, ListNode next) { this.val = val; this.next = next; } | |
* } | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyStack { | |
private Queue<Integer> q; | |
public MyStack() { | |
this.q = new LinkedList(); | |
} | |
public void push(int x) { | |
q.add(x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyQueue { | |
private Stack<Integer> s1; | |
private Stack<Integer> s2; | |
public MyQueue() { | |
s1 = new Stack<>(); | |
s2 = new Stack<>(); | |
} | |
public void push(int x) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Node { | |
public int value; | |
public Node left; | |
public Node right; | |
public Node peer; | |
public Node(int value) { | |
this.value = value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.data.annotation.Id; | |
import org.springframework.data.mongodb.core.mapping.Document; | |
@Document(collection = "stats") | |
public class StatEntry { | |
@Id | |
public String id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 | |
http://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
<servers> | |
<server> | |
<id>sonatype-nexus-snapshots</id> | |
<username>your-sonatype-username</username> | |
<password>your-sonatype-password</password> | |
</server> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>io.lenar</groupId> | |
<artifactId>app-props</artifactId> | |
<version>0.9.3-SNAPSHOT</version> | |
<packaging>jar</packaging> | |
<name>AppProps</name> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
┌───────────── minute (0 - 59) | |
│ ┌───────────── hour (0 - 23) | |
│ │ ┌───────────── day of month (1 - 31) | |
│ │ │ ┌───────────── month (1 - 12) | |
│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday to Saturday; | |
│ │ │ │ │ 7 is also Sunday on some systems) | |
│ │ │ │ │ | |
│ │ │ │ │ | |
* * * * * schedule command to execute |
NewerOlder