Skip to content

Commit 0f12502

Browse files
authored
Merge pull request #99 from AxaGuilDEv/reorg
reorg d'exercices et ajout de solution TC demi-finale 2 en js
2 parents 009ba82 + c2a956c commit 0f12502

File tree

97 files changed

+1491
-50
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+1491
-50
lines changed

TOOLS/NodeJS/src/content.js

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -26,53 +26,5 @@ const logs = (...args) => console.error(args);
2626
//console.error( $variable );
2727
//return to send result
2828
export default (input) => {
29-
let [H, L] = input.shift().split` `.map(Number);
30-
let tableau = input.map(v => v.replace(/\./g, 0).split``);
31-
32-
for(let y = 0; y < H; y++)
33-
for(let x = 0; x < L; x++)
34-
{
35-
if(tableau[y][x] == "#")
36-
{
37-
let voisinHaut = isValidPos(tableau, x, y - 1) ? tableau[y-1][x] : 0;
38-
let voisinGauche = isValidPos(tableau, x - 1, y) ? tableau[y][x-1] : 0;
39-
tableau[y][x] = Math.min(voisinHaut, voisinGauche) + 1;
40-
} else {
41-
tableau[y][x] = 0;
42-
}
43-
}
44-
45-
let max = 0;
46-
47-
for(let y = H - 1; y > -1; y--)
48-
for(let x = L - 1; x > -1; x--)
49-
{
50-
if(tableau[y][x] != 0)
51-
{
52-
let voisinDroite = isValidPos(tableau, x + 1, y) ? tableau[y][x+1] : 0;
53-
let voisinBas = isValidPos(tableau, x, y + 1) ? tableau[y+1][x] : 0;
54-
let profondeur = Math.min(voisinDroite, voisinBas) + 1;
55-
if(profondeur <= tableau[y][x])
56-
{
57-
tableau[y][x] = profondeur;
58-
if(profondeur > max)
59-
{
60-
max = profondeur;
61-
}
62-
}
63-
}
64-
}
65-
66-
return max;
29+
6730
};
68-
69-
function isValidPos(tableau2D, x, y)
70-
{
71-
let tailleYMax = tableau2D.length;
72-
let tailleXMax = tableau2D[0].length;
73-
if(x >= 0 && x < tailleXMax && y >= 0 && y < tailleYMax)
74-
{
75-
return true;
76-
}
77-
return false;
78-
}
File renamed without changes.

TRAINING/OTHERS/banderoles/banderoles-John.js renamed to TRAINING/2016/BattleDev0316/exo5-banderoles/banderoles-John.js

File renamed without changes.

TRAINING/OTHERS/affichePeugeot/affichePeugeot-RemiB.js renamed to TRAINING/2016/Mdf2016/exo5-AffichesPeugeot/affichePeugeot-RemiB.js

File renamed without changes.

TRAINING/OTHERS/affichePeugeot/affichePeugeot-RemiF.js renamed to TRAINING/2016/Mdf2016/exo5-AffichesPeugeot/affichePeugeot-RemiF.js

File renamed without changes.
File renamed without changes.

TRAINING/reponseAUnExerciceARetrouverBipartiteMatching.js renamed to TRAINING/2017/MdF0917-Finale/exo1-slalomEnKayak/slalomEnKayak_BipartiteMatching-RemiB.js

File renamed without changes.

TRAINING/OTHERS/bureauxSalesforce/bureauxSaleforces-Clement.java renamed to TRAINING/2017/MdfSeptembreSession1/exo1-bureauxSalesforce/bureauxSaleforces-Clement.java

File renamed without changes.

TRAINING/OTHERS/bureauxSalesforce/bureauxSaleforces-RemiB.js renamed to TRAINING/2017/MdfSeptembreSession1/exo1-bureauxSalesforce/bureauxSaleforces-RemiB.js

File renamed without changes.

TRAINING/OTHERS/bureauxSalesforce/bureauxSalesforce-John.js renamed to TRAINING/2017/MdfSeptembreSession1/exo1-bureauxSalesforce/bureauxSalesforce-John.js

File renamed without changes.

0 commit comments

Comments
 (0)