<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Mardonbek</title>
    <description>The latest articles on Forem by Mardonbek (@mardon1dev).</description>
    <link>https://forem.com/mardon1dev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1422802%2Fa7f430e8-06be-407c-bca4-5e1d44eeeab2.png</url>
      <title>Forem: Mardonbek</title>
      <link>https://forem.com/mardon1dev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mardon1dev"/>
    <language>en</language>
    <item>
      <title>Find Valid Matrix Given Row and Column Sums.</title>
      <dc:creator>Mardonbek</dc:creator>
      <pubDate>Sat, 20 Jul 2024 15:40:49 +0000</pubDate>
      <link>https://forem.com/mardon1dev/find-valid-matrix-given-row-and-column-sums-1n2o</link>
      <guid>https://forem.com/mardon1dev/find-valid-matrix-given-row-and-column-sums-1n2o</guid>
      <description>&lt;p&gt;In this code, it is displayed how to restore matrix.&lt;br&gt;
var restoreMatrix = function(rowSum, colSum) {&lt;br&gt;
     let m = rowSum.length;&lt;br&gt;
    let n = colSum.length;&lt;br&gt;
    let matrix = new Array(m).fill(0).map(() =&amp;gt; new Array(n).fill(0));&lt;br&gt;
    for (let i = 0; i &amp;lt; m; i++) {&lt;br&gt;
        for (let j = 0; j &amp;lt; n; j++) {&lt;br&gt;
            matrix[i][j] = Math.min(rowSum[i], colSum[j]);&lt;br&gt;
            rowSum[i] -= matrix[i][j];&lt;br&gt;
            colSum[j] -= matrix[i][j];&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
    return matrix;&lt;br&gt;&lt;br&gt;
};&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Lucky Numbers in a Matrix</title>
      <dc:creator>Mardonbek</dc:creator>
      <pubDate>Fri, 19 Jul 2024 07:01:33 +0000</pubDate>
      <link>https://forem.com/mardon1dev/lucky-numbers-in-a-matrix-33n2</link>
      <guid>https://forem.com/mardon1dev/lucky-numbers-in-a-matrix-33n2</guid>
      <description>&lt;p&gt;*&lt;em&gt;This code describes how to find a lucky number in a matrix. *&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;const luckyNumber = (matrix)=&amp;gt;{&lt;br&gt;
    let num = []&lt;br&gt;
    for (let i = 0; i &amp;lt; matrix.length; i++) {&lt;br&gt;
        let arr = matrix[i];&lt;br&gt;
        let rowMax = Math.min(...arr);&lt;br&gt;
        let columnIndex = matrix[i].indexOf(rowMax);&lt;br&gt;
        let column = matrix.map((row) =&amp;gt; row[columnIndex]);&lt;br&gt;
        let columnMax = Math.max(...column);&lt;br&gt;
        if (rowMax === columnMax) {&lt;br&gt;
            num.push(rowMax);&lt;br&gt;
        }&lt;br&gt;
    }&lt;br&gt;
    return num;&lt;br&gt;
}&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>leetcode</category>
      <category>coding</category>
    </item>
  </channel>
</rss>
