This file contains hidden or 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 MinimumWindowSubstring { | |
public static void main(String[] args) { | |
assertEquals("ba", minWindow("bba", "ab")); | |
assertEquals("b", minWindow("ab", "b")); | |
assertEquals("", minWindow("ab", "")); | |
assertEquals("bc", minWindow("abc", "bc")); | |
assertEquals("ab", minWindow("abc", "ab")); | |
assertEquals("b", minWindow("abc", "b")); |
This file contains hidden or 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
/** | |
* Created by dmgcodevil on 2/27/2017. | |
*/ | |
object Existential { | |
// M[T] forSome { type T; } is the type of all things for which there is some T such that they are of type M[T] | |
// it's possible to use type bounds: T <: Number | |
type AllArrays = Array[T] forSome {type T} // -> Array[_] ; the type of all arrays | |
type AnyArray = Array[T forSome {type T}] // -> Array[Any] |
This file contains hidden or 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
/** | |
* Created by dmgcodevil on 2/27/2017. | |
*/ | |
object Phantom { | |
object Hacker { | |
sealed trait State | |
object State { |
This file contains hidden or 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 java.util.ArrayList; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.List; | |
import java.util.Scanner; | |
public class SegmentAndPoint { | |
public static final OrderY ORDER_Y = new OrderY(); | |
public static final OrderX ORDER_X = new OrderX(); |
This file contains hidden or 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
package seg; | |
import java.util.Comparator; | |
import java.util.Scanner; | |
import java.util.TreeSet; | |
public class SegmentAndPoint { | |
private static int[] fastCountSegments(int[] starts, int[] ends, int[] points) { |
This file contains hidden or 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
I, Roman_Pleshkov, have read and do accept the MuleSoft Contributor Agreement | |
at http://www.mulesoft.org/legal/contributor-agreement.html | |
Accepted on Tue Apr 14 2015 16:25:47 GMT+0300 (Belarus Standard Time) |
NewerOlder