You have to list all the gene combinations of two parents, from their blood type and the blood type of one of their children.
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
| /** | |
| * Afin de détecter des erreurs dans des identifiants numériques, une clé de contrôle est souvant ajoutée à cet identifiant. | |
| * <p> | |
| * Implémentez la méthode {@code computeCheckDigit(identifiantNumber)} qui prend en entrée un identifiant | |
| * (sous la forme d'une chaîne de caractères) et qui retourne la clé de contrôle en utilisant l'algorithme qui suit : | |
| * <ul> | |
| * <li>Faites la somme des chiffres situées à des positions paires (positions 0, 2, 4, etc.).</li> | |
| * <li>Multipliez le résultat par tois.</li> | |
| * <li>Ajoutez à ce nombre la somme des chiffres situés à des positions impaires (positions 1, 3, 5, etc.).</li> | |
| * <li>Prenez le dernier chiffre de ce résultat.</li> |
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.Scanner; | |
| import static java.lang.Integer.toBinaryString; | |
| /** | |
| * We like to measure the outcome of our activities and the similarities between | |
| * different projects. | |
| * <p> | |
| * The measure of the similarity between two projects is the number of positions (in their | |
| * binary representation) at which the corresponding bits of their identifiers are different. |
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
| /** | |
| * My daughter is currently learning addition at school. She sometimes gets things | |
| * wrong when summing up two digits. | |
| * <p> | |
| * Given the two initial numbers and her calculated result, you have to check if is | |
| * correct. | |
| * <ul> | |
| * <li>If yes, output the string "ok"</li> | |
| * <li>If no, return the digit index on where she got it wrong (converted to a string). | |
| * Unit digit has the index "0", tens digit has the index "1", etc.</li> |
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
| /** | |
| * Alors que vous vous promeniez dans les rayons d'une librarie peu recommandable, | |
| * vous trouvez par hasard un carnet de notes écrit par le célèbre savant fou Hubert Zweistein. | |
| * Vous aimeriez connaître son contenu, mais il est écrit en étrange langage codé. | |
| * <p> | |
| * Assez rapidement, vous faites une découverte : les lignes sont groupées 3 par 3, | |
| * et chaque groupe contient le même nombre de lettres. En alternant les lettres | |
| * des différents lignes, un message apparaît ! | |
| * <p> | |
| * À partir de trois lignes du livre, alternez les lettres : |
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
| /** | |
| * Pour éviter la confusion entre les multiples de 1000 octets et les multiples de | |
| * 1024 octets, les terms "kibioctet", "mébioctet", etc. ont été inventés. | |
| * <ul> | |
| * <li>Un kibioctet (abrégé KiB) correspond à 1024 octets.</li> | |
| * <li>Un mébioctet (MiB) correspond à (1024*1024 = 1048576) octets</li> | |
| * </ul> | |
| * <p> | |
| * Étant donné une quantité d'octets : | |
| * <ul> |
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.Scanner; | |
| /** | |
| * Tic-tac-toe or noughts and crosses is a childhood game where players take turns playing X's and O's | |
| * on a 3x3 board trying to get three in a row. Here's an example game where O is victorious: | |
| * <p> | |
| * Write a function that takes an NxN game board as input and returns true or false depending on whether it's a valid board. | |
| * The valid states for squares of the board are "X", "O", and "~" (no one has played there yet).<br> | |
| * Examples of valid boards: | |
| * <ol style="margin-top: 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.Scanner; | |
| /** | |
| * You are in a storage room full of boxes. We want to make some room by moving the empty boxes to the end of the room and not moving the other side. | |
| * Given an integer array containing the weights of the boxes, write a function to moves all the empty boxes to the end of the room. | |
| * <p/> | |
| * <b>INPUT: </b> | |
| * <b>Line1: The N weights</b> | |
| * <p/> | |
| * <b>OUTPUT:</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
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.Scanner; | |
| /** | |
| * Kaido has a precious chest with a number written on it. The chest has two keyholes. | |
| * He also has a keychain with n keys on it. A number of labels each key. | |
| * To unlock this chest, we need to insert two of his keys such as the labels on them sum up to the number written on the chest. | |
| * Can you help to unlock this chest ? | |
| * <p/> |
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.HashMap; | |
| import java.util.Map; | |
| /** | |
| * Vous êtes enseignant et vous soupçonnez vos élèves d'échanger des messages secrets pendant vos cours. | |
| * <p> | |
| * Vous avez confisqué une feuille à Alice. Il semble qu'elle préparait un message pour son ami Bob. | |
| * La première phrase de la feuille est en clair, la seconde est codée. La méthode semble être un chiffrement par substitution. | |
| * Chaque lettre du texte en clair correspond toujours à la même lettre chiffrée. Par chaque, la phrase initiale contient toutes les lettres de l'alphabet, | |
| * ce qui vous permet de déduire la correspondance complète des lettres. |