Решить задачу javascript
5 USDмне пришло замечание по заданию https://www.codewars.com/kata/58983deb128a54b530000be6/train/javascript :
function bracesStatus(string) {
const array = ['(', ')', '[', ']', '{', '}'];
let bracketsArrays = [['('],[')'],['['],[']'],['{'],['}']];
let checkExp = Array();
const exp = string.split('');
exp.forEach(elem => {
if (array.includes(elem)) {
checkExp.push(elem)
}
})
checkExp.forEach(elem=>{
array.forEach(ar=>{
if (elem == ar){
bracketsArrays.forEach((br,i,arr)=>{
if (br[0] == ar){
arr[i].push(ar);
}
})
}
})
})
if (bracketsArrays[0].length == bracketsArrays[1].length && bracketsArrays[2].length == bracketsArrays[3].length && bracketsArrays[4].length == bracketsArrays[5].length) {
return true
} else {
return false
}
}
Помогите разобраться с замечаниями по моему решению
-
Добрый день, Антон!
Давайте обсудим все детали, помогу
Обращайтесь - буду рад сотрудничеству!
-
80 Здравствуйте. Уже есть готовый код для решения данной задачи, если интересно обращайтесь в лс.
-
124 Мне нравится решать подобные задачки.
Хочу решить и эту, если позволите!
-
3029 379 7 1 у вас там код не верно написан, могу написать эту функцию
= - =- =- =- =- =- =- =- = - =- =- =- =- =- =- =- = - =- =- =- =- =- =- =-
-
Покажите замечание. Такую задачу можно решить при помощи стэка.
-
Current freelance projects in the category JavaScript
Website layout according to the design.
510 USD
Good day. There is a layout in Figma: https://www.figma.com/file/RGVIymprYc4QaiJ5qp3iwL/LayerGame?type=design&node-id=0-1&mode=design There is a UI kit and a ready-made layout of the Main page, implemented in React, animations are done using GSAP. It is necessary to layout 2… HTML and CSS, JavaScript ∙ 28 proposals |
ParallaxIt is necessary to make such a parallax as here https://www.bangbangforever.com/#artists, that is, a video block video (everything is already laid out) and also part of the parallax is ready, stack Next.js JavaScript ∙ 1 proposal |
Set up Facebook Pixel and Google Analytics events on the websiteSet up Facebook Pixel and Google Analytics events on the website. Do this through the website admin panel, simply add scripts there or through GTM. JavaScript, Web programming ∙ 5 proposals |
Calculator for calculating the cost per m2 for a blinds websiteHello everyone, I need to create a calculator for calculating the cost of a product based on its width and height. Calculation example: Horizontal blinds 0.75 m2Fabric roller blinds 0.60 m2Mosquito nets 0.75 m2Roman blinds 1 m2Japanese blinds 0.60 m2Protective roller blinds 1.3… JavaScript, PHP ∙ 11 proposals |
Stylize Select option WordpressTask to style the standard Select option with appropriate styles. Problem: when using replacement of dropdown with list through jquery: filters for sorting products do not work. JavaScript, PHP ∙ 9 proposals |