{"id":2493,"date":"2022-08-30T15:46:49","date_gmt":"2022-08-30T15:46:49","guid":{"rendered":"https:\/\/lvboard.infostore.in.ua\/?p=2493"},"modified":"2022-08-30T15:46:49","modified_gmt":"2022-08-30T15:46:49","slug":"%d0%b2%d0%be%d0%bf%d1%80%d0%be%d1%81%d1%8b-%d0%ba%d0%be%d1%82%d0%be%d1%80%d1%8b%d0%b5-%d0%bc%d0%bd%d0%b5-%d0%b7%d0%b0%d0%b4%d0%b0%d0%b2%d0%b0%d0%bb%d0%b8-%d0%bd%d0%b0-%d1%84%d1%80%d0%be%d0%bd%d1%82","status":"publish","type":"post","link":"https:\/\/lvboard.infostore.in.ua\/?p=2493","title":{"rendered":"\u0412\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0430 \u0444\u0440\u043e\u043d\u0442\u0435\u043d\u0434-\u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445"},"content":{"rendered":"\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u043e\u0431\u0440\u0430\u043b \u0432\u0441\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043f\u0430\u043d\u0434\u0435\u043c\u0438\u0438 COVID-19. \u042f \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u043a \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e.<br><br><br>\u0412\u043e\u043f\u0440\u043e\u0441\u044b \u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u043d\u0430 \u0447\u0435\u0442\u044b\u0440\u0435 \u0447\u0430\u0441\u0442\u0438.<\/p>\n\n\n\n<!--more-->\n\n\n\n<ul><li>JS<\/li><li>\u041a\u043e\u0434<\/li><li>\u0417\u0430\u0434\u0430\u0447\u0438<\/li><li>\u0414\u0440\u0443\u0433\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b<\/li><\/ul>\n\n\n\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435\u043c, \u043d\u043e \u043b\u0438\u0448\u044c \u0434\u0430\u0435\u0442 \u043e\u0431\u0449\u0435\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u043c\u043e\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439.<\/p>\n\n\n\n<p><em>\u041e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043e 20.08.2020.&nbsp;<\/em><a href=\"https:\/\/github.com\/devAbhijeet\/job-hunt-interview-questions-2020\/commit\/f4be0455a740db89e6c1dc48108123168b0e2ee9\"><em>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c<\/em><\/a><em>&nbsp;\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/em><\/p>\n\n\n\n<h3>JS<\/h3>\n\n\n\n<p>1. \u0415\u0441\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u043e\u0439 N, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0443\u0436\u043d\u043e \u0441\u0433\u043b\u0430\u0434\u0438\u0442\u044c. \u041f\u043e\u0441\u043b\u0435 \u0441\u0433\u043b\u0430\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0435\u0433\u043e \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u043f\u0440\u0438\u0432\u044f\u0436\u0438\u0442\u0435 \u043a \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430&nbsp;<code>array<\/code>.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/**\n * &#91;1,2,&#91;3,4]] -&gt; &#91;1,2,3,4]\n *\/\n\n<strong>let<\/strong> arr = &#91;1,2,&#91;3,4, &#91;5,6, &#91;7, &#91;8, 9, 10]]]]]\n\n<strong>function<\/strong> <strong>flatten<\/strong>(arr) {\n  <strong>return<\/strong> arr.reduce(<strong>function<\/strong>(acc, next){\n    <strong>let<\/strong> isArray =  Array.isArray(next)\n    <strong>return<\/strong> acc.concat(isArray ? flatten(next) : next)\n  }, &#91;])\n}\n\n<strong>if<\/strong> (!Array.prototype.flatten) {\n  Array.prototype.flatten = <strong>function<\/strong>() {\n    <strong>return<\/strong> flatten(<strong>this<\/strong>)\n  }\n}\nconsole.log(arr.flatten());\n<\/code><\/pre>\n\n\n\n<p>2. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u0440\u043e\u043c\u0438\u0441 \u0441 \u043d\u0443\u043b\u044f<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>class<\/strong> <strong>CustomPromise<\/strong> {\n  state = \"PENDING\"\n  value = undefined\n  thenCallbacks = &#91;]\n  errorCallbacks = &#91;]\n\n  <strong>constructor<\/strong>(action) {\n    action(<strong>this<\/strong>.resolver.bind(<strong>this<\/strong>), <strong>this<\/strong>.reject.bind(<strong>this<\/strong>))\n  }\n\n  resolver(value) {\n    <strong>this<\/strong>.state = \"RESOLVED\"\n    <strong>this<\/strong>.value = value\n    <strong>this<\/strong>.thenCallbacks.forEach((callback) =&gt; {\n      callback(<strong>this<\/strong>.value)\n    })\n  }\n\n  reject(value) {\n    <strong>this<\/strong>.state = \"REJECTED\"\n    <strong>this<\/strong>.value = value\n    <strong>this<\/strong>.errorCallbacks.forEach((callback) =&gt; {\n      callback(<strong>this<\/strong>.value)\n    })\n  }\n\n  then(callback) {\n    <strong>this<\/strong>.thenCallbacks.push(callback)\n    <strong>return<\/strong> <strong>this<\/strong> \n  }\n\n  <strong>catch<\/strong> (callback) {\n    <strong>this<\/strong>.errorCallbacks.push(callback)\n    <strong>return<\/strong> <strong>this<\/strong> \n  }\n}\n\n<strong>let<\/strong> promise = <strong>new<\/strong> CustomPromise((resolver, reject) =&gt; {\n  setTimeout(() =&gt; {\n    <strong>const<\/strong> rand = Math.ceil(Math.random(1 * 1 + 6) * 6)\n    <strong>if<\/strong> (rand &gt; 2) {\n      resolver(\"Success\")\n    } <strong>else<\/strong> {\n      reject(\"Error\")\n    }\n  }, 1000)\n})\n\npromise\n  .then(<strong>function<\/strong>(response){\n    console.log(response)\n  })\n  .catch(<strong>function<\/strong>(error){\n    console.log(error)\n  })\n<\/code><\/pre>\n\n\n\n<p>3. \u041e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u0443\u0439\u0442\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u0444\u0438\u043b\u044c\u043c\u043e\u0432 \u043f\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u043c\u0443 \u0440\u0435\u0439\u0442\u0438\u043d\u0433\u0443, \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e. \u041e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u043e\u0442\u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e \u043b\u044e\u0431\u043e\u043c\u0443 \u043f\u043e\u043b\u044e.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ O(M)\n<strong>function<\/strong> <strong>getMovies<\/strong>() {\n  <strong>return<\/strong> &#91;]; \/\/ &#91;{id, name, year}]\n}\n\n\/\/ O(R)\n<strong>function<\/strong> <strong>getRatings<\/strong>() {\n  <strong>return<\/strong> &#91;]; \/\/ &#91;{id, movie_id, rating}]   0 &lt;= rating &lt;= 10   \/\/ e.g 9.3\n}\n\n\/**\n * minAvgRating -&gt;\n *    avgRating &gt;= minAvgRating\n *\n * sort -&gt;\n *    name -&gt; ascending order movies by name\n *   -name -&gt; descending\n *\n *    avgRating\n * \n *\n * search -&gt;\n *   'ave' -&gt; 'Avengers'\n *   'avengers' -&gt; 'Avengers'\n *   'AvengersInfinitywar' -&gt; 'Avengers'\n *\/\n<strong>const<\/strong> toLower = str =&gt; str.toLocaleLowerCase()\n\n<strong>const<\/strong> getAvrgRating = (movie, movingWithRatings) =&gt; {\n  <strong>let<\/strong> count = 0;\n  <strong>return<\/strong> movingWithRatings.reduce((acc, value, index) =&gt; {\n    <strong>const<\/strong> movieMatch = movie.id === value.movie_id\n    <strong>if<\/strong> (movieMatch) {\n      acc+=value.rating\n      count++\n    }\n    <strong>if<\/strong> (index === movingWithRatings.length - 1) {\n      acc = acc\/count\n    }\n    <strong>return<\/strong> acc\n  }, 0)\n}\n\n<strong>const<\/strong> isSubString = (str1, str2) =&gt; {\n  str1 = toLower(str1.split(\" \").join(\"\"))\n  str2 = toLower(str2.split(\" \").join(\"\"))\n  <strong>if<\/strong> (str1.length &gt; str2.length) {\n    <strong>return<\/strong> str1.startWith(str2)\n  } <strong>else<\/strong> {\n    <strong>return<\/strong> str2.startWith(str1)\n  }\n}\n\n<strong>const<\/strong> moviesList = getMovies()\n<strong>const<\/strong> movingWithRatings = getRatings();\n<strong>function<\/strong> <strong>queryMovies<\/strong>({ search, sort, minAvgRating }) {\n  <strong>let<\/strong> filteredMovies = movingWithRatings.filter(movie =&gt; getAvrgRating(movie, movingWithRatings) &gt;= minAvgRating);\n  filteredMovies = filteredMovies.map(movie =&gt; moviesList.filter(listItem =&gt; listItem.id === movie.movie_id).pop())\n  filteredMovies = filteredMovies.filter(movie =&gt; isSubString(toLower(movie.name), toLower(search)))\n  filteredMovies = filteredMovies.sort((a, b) =&gt; {\n    <strong>const<\/strong> isDescending = sort&#91;0] === '-' ? true : false\n    <strong>let<\/strong> sortCopy = isDescending ? sort.slice(1) : sort\n    <strong>const<\/strong> value1 = a&#91;sortCopy]\n    <strong>const<\/strong> value2 = b&#91;sortCopy]\n    <strong>if<\/strong> (isDescending) {\n      <strong>return<\/strong> value1 &gt; value2 ? -1 : 1\n    }<strong>else<\/strong> {\n      <strong>return<\/strong> value1 &lt; value2 ? -1 : 1\n    }\n  })\n  filteredMovies = filteredMovies.map(movie =&gt; ({\n    ...movie,\n    avgRating: movingWithRatings.filter(ratedMovie =&gt; ratedMovie.movie_id === movie.id)&#91;0].rating\n  }))\n  <strong>return<\/strong> filteredMovies\n}\n<\/code><\/pre>\n\n\n\n<p>4. \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u0435 \u0432\u0441\u0435&nbsp;<code>\u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438<\/code>&nbsp;\u0438&nbsp;<code>\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438<\/code>&nbsp;\u043f\u043e URL-\u0430\u0434\u0440\u0435\u0441\u0443 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438. \u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435.<\/p>\n\n\n\n<ul><li>\u0421\u043e\u043e\u0442\u043d\u0435\u0441\u0438\u0442\u0435 \u0432\u0441\u0435 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \u0441 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f\u043c\u0438, \u043a \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043e\u043d\u0438 \u043e\u0442\u043d\u043e\u0441\u044f\u0442\u0441\u044f. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443.<\/li><\/ul>\n\n\n\n<p><a href=\"https:\/\/github.com\/devAbhijeet\/cure-fit-interview-challenge\/tree\/master\/\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/service.js\n<strong>const<\/strong> POSTS_URL = `https:\/\/jsonplaceholder.typicode.com\/posts`;\n<strong>const<\/strong> COMMENTS_URL = `https:\/\/jsonplaceholder.typicode.com\/comments`;\n\n<strong>export<\/strong> <strong>const<\/strong> fetchAllPosts = () =&gt; {\n  <strong>return<\/strong> fetch(POSTS_URL).then(res =&gt; res.json());\n};\n\n<strong>export<\/strong> <strong>const<\/strong> fetchAllComments = () =&gt; {\n  <strong>return<\/strong> fetch(COMMENTS_URL).then(res =&gt; res.json());\n};\n\n\n<strong>import<\/strong> { fetchAllPosts, fetchAllComments } <strong>from<\/strong> \".\/service\";\n\n\n\n<strong>const<\/strong> fetchData = <strong>async<\/strong> () =&gt; {\n  <strong>const<\/strong> &#91;posts, comments] = <strong>await<\/strong> Promise.all(&#91;\n    fetchAllPosts(),\n    fetchAllComments()\n  ]);\n\n  <strong>const<\/strong> grabAllCommentsForPost = postId =&gt;\n    comments.filter(comment =&gt; comment.postId === postId);\n\n  <strong>const<\/strong> mappedPostWithComment = posts.reduce((acc, post) =&gt; {\n    <strong>const<\/strong> allComments = grabAllCommentsForPost(post.id);\n    acc&#91;post.id] = allComments;\n    <strong>return<\/strong> acc;\n  }, {});\n\n  console.log(\"mappedPostWithComment \", mappedPostWithComment);\n};\n\nfetchData();\n<\/code><\/pre>\n\n\n\n<p>5. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u043c\u0435\u0442\u043e\u0434&nbsp;<code>getHashCode<\/code>&nbsp;\u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 string. \u041c\u0435\u0442\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0441\u0442\u0440\u043e\u043a.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>let<\/strong> s1 = \"sample\"\n\n<strong>if<\/strong> (!String.prototype.getHashCode) {\n  String.prototype.getHashCode = <strong>function<\/strong>(){\n    console.log('String instance ', <strong>this<\/strong>)\n    <strong>return<\/strong> <strong>this<\/strong>\n  }\n}\n<\/code><\/pre>\n\n\n\n<p>6. \u041a\u0430\u043a\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0445 \u043d\u0438\u0436\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439?<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>    1+true\n    true+true\n    \u20181\u2019+true\n    \u20182\u2019 &gt; \u20193\u2019\n    \u2018two\u2019&gt;\u2019three\u2019\n<\/code><\/pre>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>2\n2\n1true\nfalse\ntrue<\/code><\/pre>\n\n\n\n<p>7. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u044b&nbsp;<code>bind<\/code>&nbsp;\u0438&nbsp;<code>reduce<\/code>.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/bind\n<strong>if<\/strong> (!Function.prototype.bind) {\n  Function.prototype.bind = <strong>function<\/strong>(...arg){\n    <strong>const<\/strong> func = <strong>this<\/strong>\n    <strong>const<\/strong> context = arg&#91;0]\n    <strong>const<\/strong> params = arg.slice(1)\n    <strong>return<\/strong> <strong>function<\/strong>(...innerParam) {\n      func.apply(context, &#91;...params, ...innerParam])\n    }\n  }\n}\n\n\/\/reduce\nArray.prototype.reduce = <strong>function<\/strong>(func, initState) {\n  <strong>const<\/strong> arr = <strong>this<\/strong>\n  <strong>const<\/strong> callback = func\n  <strong>let<\/strong> init = initState\n\n  arr.forEach(<strong>function<\/strong>(value, index){\n      init=callback(init, value)\n  })\n  <strong>return<\/strong> init\n}\n<\/code><\/pre>\n\n\n\n<p>8. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e debounce<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>const<\/strong> debounce = <strong>function<\/strong>(func, interval) {\n  <strong>let<\/strong> timerId;\n  <strong>return<\/strong> <strong>function<\/strong>(e){\n    clearTimeout(timerId)\n    timerId = setTimeout(<strong>function<\/strong>(){\n      func.apply()\n    }, interval)\n  }\n}\ndebounce(apiCall, 3000)\n<\/code><\/pre>\n\n\n\n<p>9. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e throttle<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>const<\/strong> throttle = (callback, interval) =&gt; {\n  <strong>let<\/strong> timerId;\n  <strong>let<\/strong> allowEvents = true;\n\n  <strong>return<\/strong> <strong>function<\/strong>() {\n    <strong>let<\/strong> context = <strong>this<\/strong>;\n    <strong>let<\/strong> args = arguments;\n\n    <strong>if<\/strong> (allowEvents) {\n      callback.apply(context, args)\n      allowEvents = false;\n      timerId = setTimeOut(<strong>function<\/strong>(){\n        allowEvents = true\n      }, interval)\n    }\n  }\n}\n<\/code><\/pre>\n\n\n\n<p>10. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f API. \u0412\u044b\u0437\u043e\u0432 API \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0432\u0430\u043b\u044b. \u042d\u0442\u043e API \u0444\u043e\u043d\u0434\u043e\u0432\u043e\u0433\u043e \u0440\u044b\u043d\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043a\u043e\u0442\u0438\u0440\u043e\u0432\u043a\u0430\u0445. \u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u043e\u0442\u0440\u0430\u0437\u0438\u0442\u0435 \u0438\u0445 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435.<\/p>\n\n\n\n<p>\u041d\u0443\u0436\u043d\u043e \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043a \u0440\u0435\u0448\u0435\u043d\u0438\u044e, \u043a\u043e\u0434 \u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u0421 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0430 setInterval, \u0434\u0435\u043a\u043e\u0440\u0430\u0442\u043e\u0440\u0430 throttle \u0438 \u0444\u043b\u0430\u0433\u043e\u0432\nsetInterval=&gt;Endpoint=&gt;Render\n\n\/\/\u0441 \u0438\u043d\u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f\n\/\/Endpoint=&gt;Render=&gt;setTimeout=&gt;Endpoint=&gt;Render=&gt;SetTimeout...<\/code><\/pre>\n\n\n\n<p>11. \u041a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u044d\u0442\u043e\u0442 \u043a\u043e\u0434, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043d\u0430 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0432 ES5.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>class<\/strong> <strong>Parent<\/strong>(<strong>name<\/strong>){\n  <strong>constructor<\/strong>(name) {\n    <strong>this<\/strong>.name=name\n  }\n\n  getName(){<strong>return<\/strong> <strong>this<\/strong>.name}\n}\n\n<strong>class<\/strong> <strong>Children<\/strong> <strong>extends<\/strong> <strong>Parent<\/strong> {\n  <strong>constructor<\/strong>(props){\n    <strong>super<\/strong>(props)\n  }\n}<\/code><\/pre>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>function<\/strong> <strong>Parent<\/strong>(name) {\n  <strong>this<\/strong>.name = name\n}\n\nParent.prototype.getName = <strong>function<\/strong>() {\n  <strong>return<\/strong> <strong>this<\/strong>.name\n}\n\n<strong>function<\/strong> <strong>Children<\/strong>(name){\n  Parent.call(<strong>this<\/strong>, name)\n}\n\nChildren.prototype = <strong>new<\/strong> Parent()\n<\/code><\/pre>\n\n\n\n<p>12. \u0427\u0442\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434?<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/Q.1\n<strong>var<\/strong> x = 1;\n<strong>var<\/strong> y = x;\n\nx = 0;\nconsole.log(x, y);\n\n\/\/Q.2\n<strong>var<\/strong> x = &#91;1];\n<strong>var<\/strong> y = x;\n\nx = &#91;];\nconsole.log(x,y);\n\n\/\/Q.3\n<strong>function<\/strong> <strong>Abc<\/strong>() { console.log(<strong>this<\/strong>); };\nAbc()\n<strong>new<\/strong> Abc();\n\n\/\/Q.4\n<strong>var<\/strong> x = 1;\n<strong>var<\/strong> obj = {\n  x: 2,\n  getX: <strong>function<\/strong> () {\n    <strong>return<\/strong> console.log(<strong>this<\/strong>.x);\n  }\n};\n\nobj.getX()\n<strong>let<\/strong> a = obj.getX\nconsole.log(a)\n\n\/\/Q.5\n\/\/\u041a\u0430\u043a \u0432\u044b\u0432\u0435\u0441\u0442\u0438 2 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 a \u0432 \u043a\u043e\u0434\u0435 \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u0430?\n\n\/\/Q.6\nconsole.log(\"A\");\nsetTimeout(() =&gt; console.log(\"B\"), 0);\nsetTimeout(() =&gt; console.log(\"C\"), 0);\nconsole.log(\"D\");\n\n\/\/Q.7\nsetTimeout(<strong>function<\/strong>() {\n  console.log(\"A\");\n}, 0);\nPromise.resolve().then(<strong>function<\/strong>() {\n  console.log(\"B\");\n}).then(<strong>function<\/strong>() {\n  console.log(\"C\");\n});\n\nconsole.log(\"D\");\n\n\/\/Q.8\n<strong>let<\/strong> obj1 = {\n  a:1,\n  b:2\n}\n\n<strong>function<\/strong> <strong>mutate<\/strong>(obj) {\n  obj = {a:4, c:6}\n}\n\nconsole.log(obj1)\nmutate(obj1)\nconsole.log(obj1)\n<\/code><\/pre>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/A.1\n0 1\n\n\/\/A.2\n&#91;] &#91;1]\n\n\/\/A.3\n\u0411\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d \u043e\u0431\u044a\u0435\u043a\u0442 window\n\n\/\/A.4\n\u0411\u0443\u0434\u0443\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f 2 \u0438 1\n\n\/\/A.5\na.call(obj);\n\n\/\/A.6\nA, D, B , C\n\n\/\/A.7\nD, B, C, A\n\n\/\/A.8\n{ a: 1, b: 2 }\n{ a: 1, b: 2 }<\/code><\/pre>\n\n\n\n<p>13. \u0415\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0447\u0438\u0441\u0435\u043b. \u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>const<\/strong> list = &#91;1,2,3,4,5,6,7,8]\n<strong>const<\/strong> filteredArray = list.filter(between(3, 6)) \/\/ &#91;4,5]<\/code><\/pre>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>function<\/strong> <strong>between<\/strong>(start, end) {\n  <strong>return<\/strong> <strong>function<\/strong> (value,index) {\n    <strong>return<\/strong> value&gt;start &amp;&amp; value&lt;end\n  }\n}<\/code><\/pre>\n\n\n\n<h3>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b<\/h3>\n\n\n\n<p>1. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>A := 1\nB := A*2 + 2\nC := B*2 + 3 \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435...<\/code><\/pre>\n\n\n\n<p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f :<\/p>\n\n\n\n<ul><li>\u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0447\u0438\u0441\u043b\u043e, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u0435;<\/li><li>\u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 &#8216;GREP&#8217;, \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 \u0441\u0443\u043c\u043c\u0443 \u0447\u0438\u0441\u0435\u043b, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0431\u0443\u043a\u0432\u0430\u043c \u0441\u0442\u0440\u043e\u043a\u0438 (\u0442.&nbsp;\u0435. G + R + E + P) \u0438\u0437 \u044d\u0442\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438;<\/li><li>\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442 \u0441\u0430\u043c\u0443\u044e \u043a\u043e\u0440\u043e\u0442\u043a\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 (\u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e 32-\u0440\u0430\u0437\u0440\u044f\u0434\u043d\u043e\u0433\u043e \u0446\u0435\u043b\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430).<\/li><\/ul>\n\n\n\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0436\u0430\u0434\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u0427\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0431\u0443\u043a\u0432\u0430\u043c, \u0434\u043e\u043b\u0436\u043d\u044b \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438. \u041d\u0415 \u041d\u0423\u0416\u041d\u041e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0438\u0445 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0432 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0435 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/A = 1\n\/\/B = A*2 +2 \n\/\/C = B*2+ 3\n\/\/D = C*2+ 3\n\nvar genCharArray = function(charA, charZ) {\n    var a = &#91;], i = charA.charCodeAt(0), j = charZ.charCodeAt(0);\n    for (; i &lt;= j; ++i) {\n        a.push(String.fromCharCode(i));\n    }\n    return a;\n}\n\nvar charMap = {};\nvar charArray = genCharArray('a', 'z');\n\ncharArray.forEach(function(char, index){\n    charMap&#91;char] = Number(index + 1);\n});\n\n\nvar charSequence = function(char){\n    if(typeof char===\"string\"){\n        char = charMap&#91;char];\n    }\n    if(char==1){\n        return 1;\n    }else{\n        return char + 2 * charSequence(char-1);\n    }\n}\n\nvar input = process.argv&#91;2];\n\nif(input.length===1){\n    console.log(charSequence(charMap&#91;input]));\n}else if(input.length&gt;1){\n    var charTotalSequence = input.split(\"\").reduce(function(acc, curr){ \n        return acc + charSequence(charMap&#91;curr]);\n    },0);\n    console.log(charTotalSequence);\n}<\/code><\/pre>\n\n\n\n<p>2. \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u043f\u0430\u0440\u0443 \u0447\u0438\u0441\u0435\u043b, \u0441\u0443\u043c\u043c\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0432\u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>let<\/strong> nums = &#91;2, 7, 10, 1, 11, 15, 9]\n<strong>let<\/strong> target = 11\n<strong>let<\/strong> numsMap = <strong>new<\/strong> Map()\n<strong>let<\/strong> pairs = nums.reduce((acc, num) =&gt; {\n  <strong>let<\/strong> numToFind = target - num\n  <strong>if<\/strong> (numsMap.get(numToFind)) {\n    <strong>return<\/strong> &#91;...acc, &#91;num, numToFind]]\n  } <strong>else<\/strong> {\n    numsMap.set(num, true)\n    <strong>return<\/strong> &#91;...acc]\n  }\n}, &#91;])\n\nconsole.log(\"Pairs \", pairs)<\/code><\/pre>\n\n\n\n<p>3. \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435. \u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c&nbsp;\u2014 \u044d\u0442\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0445 \u0441\u043f\u0440\u0430\u0432\u0430 \u0438 \u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u043d\u0435\u0433\u043e. \u042f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u043d\u043e\u0442\u0430\u0446\u0438\u044e O(n). \u042d\u0442\u043e \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>let x = &#91;1, 2, 3, 5, 4] \/\/\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b: 5\nif x.length == 1 return x&#91;0]\nelse \n let i = 1\n for(;i&lt;x.length-1;i++){\n  if x&#91;i-1]&lt;x&#91;i] and x&#91;i] &gt; x&#91;i+1] return x&#91;i]\n }\n if x.length - 1 == i return x&#91;i]<\/code><\/pre>\n\n\n\n<p>4. \u041f\u043e\u0432\u0435\u0440\u043d\u0438\u0442\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432 \u043f\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0435. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0439 \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 (\u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c in-place, \u00ab\u043d\u0430 \u043c\u0435\u0441\u0442\u0435\u00bb).<\/p>\n\n\n\n<p><a href=\"https:\/\/leetcode.com\/problems\/rotate-image\/\">leetcode<\/a><\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;\n &#91;1, 2, 3],\n &#91;4, 5, 6],\n &#91;7, 8, 9]\n]\n\/\/\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u0443\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443.\n\/\/\u041f\u043e\u0441\u043b\u0435 \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a.\n&#91;\n &#91;1, 4, 7],\n &#91;2, 5, 8],\n &#91;3, 6, 9]\n]\n\/\/\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439.\n\/\/\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a.\n&#91;\n &#91;7, 4, 1],\n &#91;8, 5, 2],\n &#91;9, 6, 3]\n]\n\/\/\u041f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u0430 \u043d\u0430 90 \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432.<\/code><\/pre>\n\n\n\n<p>5. \u041c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0443\u043c\u043c\u0430 \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e M.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.geeksforgeeks.org\/maximum-subarray-sum-modulo-m\/\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/a><\/p>\n\n\n\n<p>6. \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0442\u0440\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0441\u0443\u043c\u043c\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0432\u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>let x = &#91;1, 2, 3, 4, 5]\nlet target = 7\nlet found = &#91;]\n\nconst twoPointer = (l ,r, current) =&gt; {\n  while(l&lt;r){\n    const totalSum = current + x&#91;l] + x&#91;r]\n    if (totalSum === target) {\n      found.push(&#91;current, x&#91;l], x&#91;r]])\n      return\n    } else if (totalSum &gt; target) {\n      r--\n    } else {\n      l++\n    }\n  }\n}\n\nconst threeSum = (x, target) =&gt; {\n    for (let i=0;i&lt;x.length;i++) {\n      const current = x&#91;i];\n      let leftPointer = i+1\n      let rightPointer = x.length - 1\n\n      if (current+x&#91;leftPointer]+x&#91;rightPointer] === target) {\n        found.push(&#91;current, x&#91;leftPointer], x&#91;rightPointer]])\n      } else {\n        twoPointer(leftPointer, rightPointer, current)\n      }\n  }\n  return found\n}<\/code><\/pre>\n\n\n\n<p>7. \u0415\u0441\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0430 \u0438 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e k. \u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0438\u043c\u0432\u043e\u043b \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u0435\u0442\u0441\u044f \u0440\u043e\u0432\u043d\u043e k \u0440\u0430\u0437.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.geeksforgeeks.org\/number-substrings-count-character-k\/\">\u0441\u0441\u044b\u043b\u043a\u0430<\/a><\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>const<\/strong> subStrHasSameCharCount = (str, startIndex, endIndex, totalHop) =&gt; {\n  <strong>let<\/strong> charMap = {}\n  <strong>for<\/strong> (<strong>let<\/strong> k=startIndex;k&lt;endIndex;k++) {\n    <strong>let<\/strong> currentChar = str&#91;k]\n    <strong>if<\/strong> (charMap&#91;currentChar]) {\n      charMap&#91;currentChar]++\n    } <strong>else<\/strong> {\n      charMap&#91;currentChar] = 1\n    }\n  }\n  <strong>let<\/strong> totalCount = Object.values(charMap).length &gt; 0\n  <strong>return<\/strong> totalCount ? Object.values(charMap).every(item =&gt; item == totalHop) : false\n}\n\n\n<strong>const<\/strong> characterWithCountK = (str, k) =&gt; {\n  <strong>if<\/strong> (k == 0) <strong>return<\/strong> ''\n  <strong>let<\/strong> count = 0\n  <strong>let<\/strong> initialHop = k\n  <strong>while<\/strong> (initialHop &lt; str.length) {\n    <strong>for<\/strong> (<strong>let<\/strong> j=0;j&lt;str.length;j++) {\n      <strong>let<\/strong> startIndex = j\n      <strong>let<\/strong> endIndex = j + initialHop\n      <strong>if<\/strong>(endIndex &gt; str.length) <strong>continue<\/strong>\n      count = subStrHasSameCharCount(str, startIndex, endIndex, k)\n        ? count + 1: count\n    }\n    initialHop+=k\n  }\n  count = subStrHasSameCharCount(str, 0, initialHop, k)\n        ? count + 1: count\n  <strong>return<\/strong> count\n}\n\n\n<strong>let<\/strong> str = 'aabbcc'\n<strong>let<\/strong> k = 2\nconsole.log(characterWithCountK(str, k))\n<\/code><\/pre>\n\n\n\n<p>8. \u0415\u0441\u0442\u044c \u0434\u0432\u0435 \u0441\u0442\u0440\u043e\u043a\u0438&nbsp;\u2014 s1 \u0438 s2, \u043a\u0430\u0436\u0434\u0430\u044f \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u043e\u0442 a \u0434\u043e z \u0432 \u0440\u0430\u0437\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435. \u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435, \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 s1 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0440\u043e\u043a\u0438 \u0441\u0442\u0430\u043b\u0438 \u0440\u0430\u0432\u043d\u044b\u043c\u0438.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>let<\/strong> s1 = 'dadbcbc'\n<strong>let<\/strong> s2 = 'ccbbdad'\n<strong>let<\/strong> charMap = {}\n\n<strong>const<\/strong> canBeRearranged = (s1, s2) =&gt; {\n  <strong>if<\/strong>(s1.length!==s2.length){\n    <strong>return<\/strong> false\n  }\n  <strong>for<\/strong>(<strong>let<\/strong> i=0;i&lt;s1.length;i++){\n    <strong>const<\/strong> charFromString1 = s1&#91;i]\n    <strong>const<\/strong> charFromString2 = s2&#91;i]\n    <strong>if<\/strong>(charFromString1 <strong>in<\/strong> charMap){\n      charMap&#91;charFromString1]++\n    } <strong>else<\/strong> {\n      charMap&#91;charFromString1] = 1\n    }\n    <strong>if<\/strong>(charFromString2 <strong>in<\/strong> charMap){\n      charMap&#91;charFromString2]--\n    } <strong>else<\/strong> {\n      charMap&#91;charFromString2] = -1\n    }\n  }\n  <strong>for<\/strong>(<strong>let<\/strong> x <strong>in<\/strong> charMap){\n    <strong>if<\/strong> (charMap&#91;x]!==0){\n      <strong>return<\/strong> false\n    }\n  }\n  <strong>return<\/strong> true\n}\n\ncanBeRearranged(s1, s2)\n<\/code><\/pre>\n\n\n\n<p>9. \u0415\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u043e\u0439. \u0420\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>const<\/strong> swap = (index1, index2, arr) =&gt; {\n  <strong>let<\/strong> temp = arr&#91;index1]\n  arr&#91;index1] = arr&#91;index2]\n  arr&#91;index2] = temp\n}\n\n<strong>const<\/strong> shuffle = (arr) =&gt; {\n  <strong>let<\/strong> totalLength = arr.length\n  <strong>while<\/strong>(totalLength &gt; 0) {\n    <strong>let<\/strong> random = Math.floor(Math.random() * totalLength)\n    totalLength--\n    swap(totalLength, random, arr)\n  }\n  <strong>return<\/strong> arr\n}\n\n\n<strong>let<\/strong> arr = &#91;1, 2, 3, 4, 5, 6, 7, 8, 9, 10]\narr = shuffle(arr)<\/code><\/pre>\n\n\n\n<p>10. \u0412\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435 \u0441\u0443\u043c\u043c\u0443 \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441 \u0431\u0435\u0441\u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0433\u043b\u0443\u0431\u0438\u043d\u043e\u0439.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>let<\/strong> arr = &#91;4, 5, 7, 8, &#91;5, 7, 9, &#91;3, 5, 7]]]\n<strong>let<\/strong> sum = 0\n\n<strong>const<\/strong> calculateSum = (arr) =&gt; {\n  arr.reduce(<strong>function<\/strong>(acc, currentVal) {\n    <strong>const<\/strong> isEntryArray = Array.isArray(currentVal)\n    <strong>if<\/strong> (isEntryArray) {\n      <strong>return<\/strong> acc.concat(calculateSum(currentVal))\n    } <strong>else<\/strong> {\n      sum+=currentVal\n      <strong>return<\/strong> acc.concat(currentVal)\n    }\n  }, &#91;])\n}\ncalculateSum(arr)\nconsole.log(sum)\n<\/code><\/pre>\n\n\n\n<p>11. \u0421\u0433\u043b\u0430\u0434\u044c\u0442\u0435 \u043c\u043d\u043e\u0433\u043e\u0443\u0440\u043e\u0432\u043d\u0435\u0432\u044b\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>const<\/strong> obj = {\n  level1: {\n    level2: {\n      level3: {\n        more: 'stuff', \n        other: 'otherz',\n        level4: {\n          the: 'end',\n        },\n      },\n    },\n    level2still: {\n      last: 'one',\n    },\n    am: 'bored',\n  },\n  more: 'what',\n  ipsum: {\n    lorem: 'latin',\n  },\n};\n\n<strong>var<\/strong> removeNesting = <strong>function<\/strong>(obj, parent){\n  <strong>for<\/strong> (<strong>let<\/strong> key <strong>in<\/strong> obj){\n    <strong>if<\/strong> (<strong>typeof<\/strong> obj&#91;key] === \"object\") {\n      removeNesting(obj&#91;key], parent+\".\"+key)\n    } <strong>else<\/strong> {\n      flattenedObj&#91;parent+'.'+key] = obj&#91;key]\n    }\n  }\n}\n\n<strong>let<\/strong> flattenedObj = {}\n<strong>const<\/strong> sample = removeNesting(obj, \"\");\nconsole.log(flattenedObj);<\/code><\/pre>\n\n\n\n<p>12. \u0415\u0441\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 json, \u0433\u0434\u0435 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0438 \u043c\u043e\u0436\u0435\u0442, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u043e\u0439 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442. \u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430.<\/p>\n\n\n\n<p><a href=\"https:\/\/jsbin.com\/gajiweq\/1\/edit?js,console\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/a><\/p>\n\n\n\n<p>13. \u0415\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430\u0445 (\u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u0430 \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0434\u0447\u0438\u043d\u0435\u043d\u043d\u044b\u0445). \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0441\u0442\u0440\u043e\u0439\u0442\u0435 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e \u0441\u043e\u0442\u0440\u0443\u0434\u043d\u0438\u043a\u043e\u0432.<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>const<\/strong> employeesData = &#91;{\n  id: 2,\n  name: '\u0410\u043d\u0434\u0440\u0435\u0439 (\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440)',\n  reportees: &#91;6] \n}, {\n  id: 3,\n  name: '\u0410\u043b\u0435\u043a\u0441\u0435\u0439 (\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440)',\n  reportees: &#91;]\n}, {\n  id: 6,\n  name: '\u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440 (\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b)',\n  reportees: &#91;9] \n}, {\n  id: 9,\n  name: '\u0410\u043d\u0430\u0442\u043e\u043b\u0438\u0439 (\u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0438\u043d\u0436\u0435\u043d\u0435\u0440)',\n  reportees: &#91;]\n}, {\n  id: 10,\n  name: '\u0410\u043d\u0442\u043e\u043d (\u0433\u0435\u043d\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440)',\n  reportees: &#91;2, 3],\n}];\n\n\/*\nA (\u0433\u0435\u043d\u0435\u0440\u0430\u043b\u044c\u043d\u044b\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440)\n----B (\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440)\n--------D (\u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c \u0438\u043d\u0436\u0435\u043d\u0435\u0440\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b)\n------------E (\u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0438\u043d\u0436\u0435\u043d\u0435\u0440-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a)\n----C (\u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440)\n*\/\n\n<strong>const<\/strong> findCeo = (currentEmp) =&gt; {\n  <strong>let<\/strong> parentEmployee = employeesData.filter(emp =&gt; emp.reportees.indexOf(currentEmp.id) &gt; -1)\n  <strong>if<\/strong> (parentEmployee &amp;&amp; parentEmployee.length &gt; 0) {\n    <strong>return<\/strong> findCeo(parentEmployee&#91;0])\n  } <strong>else<\/strong> {\n    <strong>return<\/strong> currentEmp\n  }\n}\n\n<strong>const<\/strong> logHierarchy = (currentEmp, indent) =&gt; {\n  console.log(\"-\".repeat(indent) + currentEmp.name)\n  indent+=4;\n  <strong>for<\/strong>(<strong>let<\/strong> i=0;i &lt;currentEmp.reportees.length;i++) {\n    <strong>let<\/strong> employee = employeesData.filter(emp =&gt; emp.id === currentEmp.reportees&#91;i])\n    logHierarchy(employee&#91;0], indent)\n  }\n}\n\n<strong>const<\/strong> traverse = (employee) =&gt; {\n  <strong>let<\/strong> ceo = findCeo(employee)\n  logHierarchy(ceo, 0)\n}\n\ntraverse(employeesData&#91;0])<\/code><\/pre>\n\n\n\n<p>14. \u041f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0439\u0442\u0435 \u0437\u0430\u0434\u0430\u043d\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0432 \u0441\u043f\u0438\u0440\u0430\u043b\u044c\u043d\u0443\u044e \u0438 \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>const<\/strong> inputMatrix = &#91;\n  &#91;1, 2, 3, 4,  5],\n  &#91;6, 7, 8, 9, 10],\n  &#91;11,12,13,14,15],\n  &#91;16,17,18,19,20],\n]\n\n<strong>const<\/strong> exprectOutput = &#91;1,2,3,4,5,10,15,20,19,18,17,16,11,6,7,8,9,14,13,12]<\/code><\/pre>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>function<\/strong> <strong>spiralParser<\/strong>(inputMatrix){\n  <strong>const<\/strong> output = &#91;];\n  <strong>let<\/strong> rows = inputMatrix.length;\n  <strong>let<\/strong> cols = rows &gt; 0 ? inputMatrix&#91;0].length : 0;\n\n  \/\/singleEmptyRow =&gt; Edge case 1 \/\/&#91;]\n  <strong>if<\/strong> (rows === 0) {\n    <strong>return<\/strong> &#91;]\n  }\n\n  <strong>if<\/strong> (rows === 1) {\n    \/\/singleElementRowNoCol =&gt; Edge case 2 \/\/&#91;&#91;]]\n    <strong>if<\/strong> (cols === 0) {\n      <strong>return<\/strong> &#91;]\n    } <strong>else<\/strong> <strong>if<\/strong> (cols === 1){\n      \/\/singleElementRow =&gt; Edge case 3 \/\/&#91;&#91;1]]\n      output.push(inputMatrix&#91;0]&#91;0])\n      <strong>return<\/strong> output \n    }\n  }\n\n  <strong>let<\/strong> top = 0;\n  <strong>let<\/strong> bottom = rows - 1;\n  <strong>let<\/strong> left = 0;\n  <strong>let<\/strong> right = cols - 1;\n  <strong>let<\/strong> direction = 0;\n  \/\/0 =&gt; left-&gt;right\n  \/\/1 =&gt; top-&gt;bottom\n  \/\/2 =&gt; right-&gt;left\n  \/\/3 =&gt; bottom-&gt;top\n\n  <strong>while<\/strong>(left &lt;= right &amp;&amp; top &lt;= bottom) {\n    <strong>if<\/strong>(direction === 0) {\n      \/\/left-&gt;right\n      <strong>for<\/strong> (<strong>let<\/strong> i=left; i&lt;=right;i++) {\n        output.push(inputMatrix&#91;top]&#91;i])\n      }\n      top++;\n    } <strong>else<\/strong> <strong>if<\/strong> (direction === 1) {\n      \/\/top-&gt;bottom\n      <strong>for<\/strong> (<strong>let<\/strong> i=top; i&lt;=bottom;i++) {\n        output.push(inputMatrix&#91;i]&#91;right])\n      }\n      right--\n    } <strong>else<\/strong> <strong>if<\/strong> (direction === 2) {\n      \/\/right-&gt;left\n      <strong>for<\/strong> (<strong>let<\/strong> i=right; i&gt;=left;i--) {\n        output.push(inputMatrix&#91;bottom]&#91;i])\n      }\n      bottom--\n    } <strong>else<\/strong> <strong>if<\/strong> (direction === 3) {\n      \/\/bottom-&gt;top\n      <strong>for<\/strong> (<strong>let<\/strong> i=bottom; i&gt;=top;i--) {\n        output.push(inputMatrix&#91;i]&#91;left])\n      }\n      left++\n    }\n    direction = (direction + 1) % 4\n  }\n  <strong>return<\/strong> output;\n}\n\nconsole.log(spiralParser(inputMatrix2))<\/code><\/pre>\n\n\n\n<p>15. \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0441\u0438\u043c\u0432\u043e\u043b \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 \u0432 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>let<\/strong> str = 'bbbaaaaccadd'; \/\/\u0411\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0432\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0439 (4) \u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 a<\/code><\/pre>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434\nmaxNow = \u0435\u0441\u043b\u0438 \u0434\u043b\u0438\u043d\u0430 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0440\u0430\u0432\u043d\u04301 \u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 1 ? 1 : 0\nmaxOverall = \u0435\u0441\u043b\u0438 \u0434\u043b\u0438\u043d\u0430 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0440\u0430\u0432\u043d\u04301 \u0438\u043b\u0438 \u0431\u043e\u043b\u044c\u0448\u0435 1 ? 1 : 0\n\n\u0434\u043b\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432 \u0432\u0445\u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c 1 \u0438 \u0431\u043e\u043b\u044c\u0448\u0435\n  \u0435\u0441\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b \u0440\u0430\u0432\u0435\u043d \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0443\n    maxNow++ \/\/\u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0442\u044c \u043d\u0430 1\n    maxOverall = max(maxOverall, maxNow)\n  \u0438\u043d\u0430\u0447\u0435 \u0435\u0441\u043b\u0438 \u0441\u0438\u043c\u0432\u043e\u043b \u043d\u0435 \u0440\u0430\u0432\u0435\u043d \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c\u0443 \u0441\u0438\u043c\u0432\u043e\u043b\u0443    \n    maxNow = 1<\/code><\/pre>\n\n\n\n<p>16. \u0415\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b. \u041f\u0435\u0440\u0435\u043c\u0435\u0441\u0442\u0438\u0442\u0435 \u0432\u0441\u0435 \u0434\u0432\u043e\u0439\u043a\u0438 (2) \u0432 \u043a\u043e\u043d\u0435\u0446 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>let<\/strong> inputArr = &#91;2,9,1,5,2,3,1,2,7,4,3,8,29,2,4,6,54,32,2,100]\n\/\/ouput =&gt; &#91;9,1,5,3,1,7,4,3,8,29,4,6,54,32,100,2,2,2,2,2]<\/code><\/pre>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>let<\/strong> slowRunner = 0\n\n<strong>for<\/strong> (<strong>let<\/strong> fastRunner=0;fastRunner&lt;arr.length;fastRunner++) {\n  <strong>if<\/strong> (arr&#91;fastRunner]!==2 &amp;&amp; arr&#91;slow] == 2) {\n    &#91;arr&#91;fastRunner], arr&#91;slow]] = &#91;arr&#91;slow], arr&#91;fastRunner]]\n    slowRunner++\n  }\n}<\/code><\/pre>\n\n\n\n<p>17. \u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043f\u0438\u0441\u043e\u043a \u0432 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u041d\u0430 \u0432\u0445\u043e\u0434\u0435 = 1 -&gt; 2 -&gt; 3 -&gt; 4 -&gt; 5 -&gt; 6\n\/\/\u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 = 1 &lt;- 2 &lt;- 3 &lt;- 4 &lt;- 5 &lt;- 6<\/code><\/pre>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434\n<strong>let<\/strong> current = head\n<strong>let<\/strong> prev = null\n<strong>let<\/strong> next = null\n\n<strong>while<\/strong>(current) {\n  next = current.next\n  current.next = prev\n  prev = current\n  current = next\n}<\/code><\/pre>\n\n\n\n<p>18. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u043f\u0440\u044f\u043c\u043e\u0439 \u043e\u0431\u0445\u043e\u0434 \u0434\u0435\u0440\u0435\u0432\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 (\u0431\u0435\u0437 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438)<\/p>\n\n\n\n<p>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/\u043f\u0441\u0435\u0432\u0434\u043e\u043a\u043e\u0434\n<strong>const<\/strong> preorder = (root) =&gt; {\n  <strong>let<\/strong> stack = &#91;]\n  stack.push(root)\n\n  \u043f\u043e\u043a\u0430(\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f stack \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435) {\n    <strong>let<\/strong> current = stack.pop()\n    console.log(current.value)\n    <strong>if<\/strong> (current.right) {\n      stack.push(current.right)\n    }\n    <strong>if<\/strong> (current.left) {\n      stack.push(current.left)\n    }\n  }\n}<\/code><\/pre>\n\n\n\n<h3>\u0417\u0430\u0434\u0430\u0447\u0438<\/h3>\n\n\n\n<p>1. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u0439\u0442\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0430\u0440\u043a\u043e\u0432\u043a\u0438, \u043e\u0442\u0432\u0435\u0447\u0430\u044e\u0449\u0443\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c.<\/p>\n\n\n\n<ul><li>\u041e\u043d\u0430 \u0445\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0431 N \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f\u0445. \u041e\u043d\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043f\u0430\u0440\u043a\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u043c\u0435\u0441\u0442.<\/li><li>\u041e\u043d\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u044a\u0435\u0437\u0436\u0430\u044e\u0449\u0438\u0435 \u0438 \u0432\u044b\u0435\u0437\u0436\u0430\u044e\u0449\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0438.<\/li><li>\u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0443\u0447\u0435\u0442\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 \u0432\u0441\u0435 \u0432\u044a\u0435\u0437\u0436\u0430\u044e\u0449\u0438\u0435 \u0438 \u0432\u044b\u0435\u0437\u0436\u0430\u044e\u0449\u0438\u0435 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0438 \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u043c: \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043d\u043e\u043c\u0435\u0440, \u0446\u0432\u0435\u0442, \u043f\u0430\u0440\u043a\u043e\u0432\u043e\u0447\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e.<\/li><\/ul>\n\n\n\n<p>\u0421\u0438\u0441\u0442\u0435\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e:<\/p>\n\n\n\n<ul><li>\u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 \u0432\u0441\u0435\u0445 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430;<\/li><li>\u043d\u043e\u043c\u0435\u0440 \u043f\u0430\u0440\u043a\u043e\u0432\u043e\u0447\u043d\u043e\u0433\u043e \u043c\u0435\u0441\u0442\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u044f \u043f\u043e \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c\u0443 \u043d\u043e\u043c\u0435\u0440\u0443;<\/li><li>\u043f\u0430\u0440\u043a\u043e\u0432\u043e\u0447\u043d\u044b\u0435 \u043c\u0435\u0441\u0442\u0430 \u0430\u0432\u0442\u043e\u043c\u043e\u0431\u0438\u043b\u0435\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0432\u0435\u0442\u0430.<\/li><li>\u0441\u043f\u0438\u0441\u043e\u043a \u0441\u0432\u043e\u0431\u043e\u0434\u043d\u044b\u0445 \u043f\u0430\u0440\u043a\u043e\u0432\u043e\u0447\u043d\u044b\u0445 \u043c\u0435\u0441\u0442.<\/li><\/ul>\n\n\n\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n\n\n\n<ul><li>\u0434\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043a\u043b\u0430\u0441\u0441\u0430\u043c\u0438\/\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438;<\/li><li>\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u043c \u0434\u043b\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/li><\/ul>\n\n\n\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043a\u043e\u0434\u0430:<\/p>\n\n\n\n<ul><li>\u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u0434\u0430;<\/li><li>\u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f \u043e\u0431 \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0438;<\/li><li>\u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b SOLID.<\/li><\/ul>\n\n\n\n<p><a href=\"https:\/\/github.com\/devAbhijeet\/parking-lot-design-js\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/a><\/p>\n\n\n\n<p>2. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 React-\u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442&nbsp;<code>Ping<\/code>, \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e API \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 URL. \u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u0434 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f 200, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u0421\u0435\u0442\u0438. \u0415\u0441\u043b\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043a\u043e\u0434 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0432 \u0421\u0435\u0442\u0438.<\/p>\n\n\n\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c&nbsp;<code>\u0441\u0442\u0430\u0442\u0443\u0441<\/code>&nbsp;\u0438\u0437 \u0441\u0435\u0442\u0435\u0432\u043e\u0439 \u043f\u0430\u043d\u0435\u043b\u0438 dev tools.<\/p>\n\n\n\n<p><a href=\"https:\/\/codesandbox.io\/s\/admiring-davinci-xnjef\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/a><\/p>\n\n\n\n<p>3. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u043e\u0440\u043c \u043d\u0430 \u0431\u0430\u0437\u0435&nbsp;<code>json<\/code>. \u0424\u043e\u0440\u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e&nbsp;<code>id<\/code>. \u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u0440\u0443\u0433\u0430\u044f \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u0430\u044f \u0433\u0440\u0443\u043f\u043f\u0430.<\/p>\n\n\n\n<p><a href=\"https:\/\/codesandbox.io\/s\/great-noyce-75kup\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/a><\/p>\n\n\n\n<p>4. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c JavaScript \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043b\u0438\u0441\u0442 Excel, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u043e\u0436\u043d\u043e&nbsp;<code>\u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c<\/code>&nbsp;\u0438&nbsp;<code>\u0443\u0434\u0430\u043b\u044f\u0442\u044c<\/code>&nbsp;\u0441\u0442\u0440\u043e\u043a\u0438 \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u044b. \u041d\u0430 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043e\u0442\u0432\u043e\u0434\u0438\u043b\u043e\u0441\u044c 40 \u043c\u0438\u043d\u0443\u0442.<\/p>\n\n\n\n<p><a href=\"https:\/\/codesandbox.io\/s\/smoosh-thunder-krv8m\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/a><\/p>\n\n\n\n<p>5. \u0421\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0438\u0441\u043a\u0430 \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439.<\/p>\n\n\n\n<p>\u041e\u0431\u044a\u0435\u043a\u0442 user (\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c) \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>id: \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\n\u0438\u043c\u044f: \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\n\u0442\u043e\u0432\u0430\u0440\u044b: \u0441\u043f\u0438\u0441\u043e\u043a \u0442\u043e\u0432\u0430\u0440\u043e\u0432, \u0437\u0430\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u043c\n\u0430\u0434\u0440\u0435\u0441: \u0430\u0434\u0440\u0435\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\n\u0438\u043d\u0434\u0435\u043a\u0441: \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f<\/code><\/pre>\n\n\n\n<p>\u041f\u043e\u0438\u0441\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u0432\u0441\u0435\u043c \u043f\u043e\u043b\u044f\u043c.<\/p>\n\n\n\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<\/p>\n\n\n\n<p><strong>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f:<\/strong><br>\u041a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0432\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044b \u0432 \u0441\u0442\u0440\u043e\u043a\u0443 \u043f\u043e\u0438\u0441\u043a\u0430, \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a. \u041f\u043e\u0438\u0441\u043a \u043c\u043e\u0436\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0435.<\/p>\n\n\n\n<p>\u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u043a\u0430\u0440\u0442\u043e\u0447\u0435\u043a \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b \u0438\u043b\u0438 \u043c\u044b\u0448\u044c\u044e.<br>\u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430, \u0438 \u043c\u044b\u0448\u044c, \u0432 \u043a\u0430\u0436\u0434\u044b\u0439 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0432\u0437\u044f\u0442\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430.<\/p>\n\n\n\n<p>(\u041d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b, \u0435\u0441\u043b\u0438 \u043c\u044b\u0448\u044c \u043d\u0430\u0432\u0435\u0434\u0435\u043d\u0430 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0441\u043f\u0438\u0441\u043a\u0430. \u0415\u0441\u043b\u0438 \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u0430 \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f, \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u044b\u0448\u0438.)<\/p>\n\n\n\n<p>\u042d\u0442\u043e \u043f\u043e\u0445\u043e\u0436\u0435 \u043d\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u043f\u043e\u0438\u0441\u043a\u0430 \u0432 YouTube<\/p>\n\n\n\n<p>\u0415\u0441\u043b\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u044b, \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u0443\u0441\u0442\u0430\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430.<br>\u0421\u043f\u0438\u0441\u043e\u043a \u043a\u0430\u0440\u0442\u043e\u0447\u0435\u043a \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044c\u0441\u044f.<\/p>\n\n\n\n<p>\u041f\u043e\u0434\u0441\u0432\u0435\u0447\u0435\u043d\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u043e\u0447\u043a\u0430 (\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043b\u0430\u0432\u0438\u0430\u0442\u0443\u0440\u044b \u0438\u043b\u0438 \u043c\u044b\u0448\u0438) \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0441\u043c\u043e\u0442\u0440\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e.<\/p>\n\n\n\n<p><a href=\"https:\/\/codesandbox.io\/s\/silly-moon-31m7u\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/a><\/p>\n\n\n\n<h3>\u0414\u0440\u0443\u0433\u0438\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b<\/h3>\n\n\n\n<p>1. \u041a\u0430\u043a \u0431\u044b \u0432\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435?&nbsp;<a href=\"https:\/\/dev.to\/vycke\/how-to-create-a-scalable-and-maintainable-front-end-architecture-4f47\">(\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c)<\/a><br>2. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0439\u0442\u0435 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044e \u043b\u0435\u043d\u0438\u0432\u043e\u0439 \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438&nbsp;<a href=\"https:\/\/css-tricks.com\/the-complete-guide-to-lazy-loading-images\/\">(\u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c)<\/a><br>3. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433?<br>4. \u041a\u0430\u043a \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c React-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u043f\u0440\u043e\u043c\u044b\u0448\u043b\u0435\u043d\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u0435?<br>5. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0441\u0435\u0440\u0432\u0438\u0441-\u0432\u043e\u0440\u043a\u0435\u0440 (\u0432\u0435\u0431-\u0432\u043e\u0440\u043a\u0435\u0440)?<br>6. \u041a\u0430\u043a \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u0432\u044b\u0441\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c?<br>7. \u0420\u0430\u0441\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u043e \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u044f\u0445 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<br>8. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 CORS?<br>9. \u041d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0432\u044b\u0441\u0448\u0435\u0433\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0430 \u0432 React.<br>10. \u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f connect \u0432 Redux?<br>11. \u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 PureComponent \u0432 React?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u044f \u0441\u043e\u0431\u0440\u0430\u043b \u0432\u0441\u0435 \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043d\u0435 \u0437\u0430\u0434\u0430\u0432\u0430\u043b\u0438 \u043d\u0430 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u043f\u0430\u043d\u0434\u0435\u043c\u0438\u0438 COVID-19. \u042f \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0435 \u043a \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044e. \u0412\u043e\u043f\u0440\u043e\u0441\u044b \u044f \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b \u043d\u0430 \u0447\u0435\u0442\u044b\u0440\u0435 \u0447\u0430\u0441\u0442\u0438.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[132],"tags":[],"_links":{"self":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2493"}],"collection":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2493"}],"version-history":[{"count":1,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2493\/revisions"}],"predecessor-version":[{"id":2494,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=\/wp\/v2\/posts\/2493\/revisions\/2494"}],"wp:attachment":[{"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lvboard.infostore.in.ua\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}