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
from random import choice | |
zero = ''' | |
------------ | |
| | | |
| | |
| | |
| | |
| |
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
# CONNAISSANCES SYNTAXIQUES | |
print('-------- FONCTION PRINT --------') | |
print("séparer", "des", "mots", "et", "terminer", sep = ".", end = "!") | |
## conversions nombre <-> chaîne de caractères | |
print('\n\n-------- CONVERSIONS --------') | |
caractere = '1' | |
caractere2 = '2' | |
print('Addition de chaînes de caractère vaut juxtaposition : ' + (caractere + caractere2)) |
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
// you can also use imports, for example: | |
import java.util.*; | |
import java.util.stream.Collectors; | |
// you can write to stdout for debugging purposes, e.g. | |
// System.out.println("this is a debug message"); | |
class Solution { | |
//codility semi primes |
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
// you can also use imports, for example: | |
import java.util.*; | |
import java.util.stream.Collectors; | |
// you can write to stdout for debugging purposes, e.g. | |
// System.out.println("this is a debug message"); | |
class Solution { | |
//codility semi primes |
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
class Scratch { | |
public static void main(String[] args) { | |
// System.out.println(abbreviation("daBcd", "ABC")); // should be YES | |
// System.out.println(abbreviation("AbCdE", "AFE")); // should be NO | |
// System.out.println(abbreviation("beFgH", "EFG")); // should be NO | |
// System.out.println(abbreviation("beFgH", "EFH")); // should be YES | |
// System.out.println(abbreviation("Pi", "P")); // should be YES | |
// System.out.println(abbreviation("UMKFW", "UMKFW")); // should be YES |
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
class Scratch { | |
public static void main(String[] args) { | |
System.out.println(maxSubsetSum(new int[] {-2, 1, 3, -4, 5})); | |
} | |
static int maxSubsetSum (int[] arr){ | |
if (arr.length == 0) { | |
return 0; |
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.*; | |
/** | |
* Implements a simple depth-first search for a graph. | |
* Limitations: does not handle a disconnected graph; does not handle cases where a vertix has multiple edges towards | |
* another given vertix; each vertix is defined by its index rather than by its value. | |
*/ | |
class Scratch { | |
public static void main(String[] args) { | |
Scratch app = new Scratch(); |
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
class Scratch { | |
public static void main(String[] args) { | |
Scratch app = new Scratch(); | |
Node root = app.setup(); | |
app.printBreadthFirst(root); | |
} | |
public void printBreadthFirst(Node node) { | |
int height = getHeight(node); |
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
//@RunWith(SpringJUnit4ClassRunner.class) // for JUnit 4 | |
//@ExtendWith(MockitoExtension.class) // for running with a Mockito runner. No Spring features | |
@ExtendWith(SpringExtension.class) // for running with a Spring runner. Loads Spring features (bean loading, etc) | |
@DisplayName("My test class name (JUnit 5)") | |
//@SpringBootTest // will load application context | |
public class MyTest { | |
// Strategy for loading one specific bean | |
// If not in a static inner class: needs to be imported on class with @Import |
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.HashSet; | |
import java.util.List; | |
import java.util.Set; | |
class Solution { | |
static final int BOARD_LENGTH = 9; | |
public static void main(String[] args) { |
NewerOlder