<?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>DEV Community: Madalina Pastiu</title>
    <description>The latest articles on DEV Community by Madalina Pastiu (@maddiepst).</description>
    <link>https://dev.to/maddiepst</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%2F2908841%2F46487fcb-cbf0-43fd-88c4-c081d3442a36.png</url>
      <title>DEV Community: Madalina Pastiu</title>
      <link>https://dev.to/maddiepst</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/maddiepst"/>
    <language>en</language>
    <item>
      <title>Anagram Detection</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Thu, 10 Jul 2025 23:56:00 +0000</pubDate>
      <link>https://dev.to/maddiepst/anagram-detection-1c66</link>
      <guid>https://dev.to/maddiepst/anagram-detection-1c66</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;An anagram is the result of rearranging the letters of a word to produce a new word (see wikipedia).&lt;/p&gt;

&lt;p&gt;Note: anagrams are case insensitive&lt;/p&gt;

&lt;p&gt;Complete the function to return true if the two arguments given are anagrams of each other; return false otherwise.&lt;/p&gt;

&lt;p&gt;Examples&lt;br&gt;
"foefet" is an anagram of "toffee"&lt;/p&gt;

&lt;p&gt;"Buckethead" is an anagram of "DeathCubeK"&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var isAnagram = function(test, original) {
  const ordered = str =&amp;gt; str.toLowerCase().split('').sort().join();
  return ordered(test) === ordered(original);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts:&lt;/em&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;I created a function named ordered that takes a string and transforms it 1st to lower case, then will split to an array of letters and sort it alphabetically. At the ens it does join the string back together in the new order.&lt;/li&gt;
&lt;li&gt;I do compare through the function above the 1st string to the 2nd string and returned true or false. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://www.codewars.com/kata/529eef7a9194e0cbc1000255/train/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 7kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>7kyu</category>
    </item>
    <item>
      <title>Welcome!</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Wed, 09 Jul 2025 21:23:00 +0000</pubDate>
      <link>https://dev.to/maddiepst/welcome-3g5l</link>
      <guid>https://dev.to/maddiepst/welcome-3g5l</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Your start-up's BA has told marketing that your website has a large audience in Scandinavia and surrounding countries. Marketing thinks it would be great to welcome visitors to the site in their own language. Luckily you already use an API that detects the user's location, so this is an easy win.&lt;/p&gt;

&lt;p&gt;The Task&lt;br&gt;
Think of a way to store the languages as a database. The languages are listed below so you can copy and paste!&lt;br&gt;
Write a 'welcome' function that takes a parameter 'language', with a type String, and returns a greeting - if you have it in your database. It should default to English if the language is not in the database, or in the event of an invalid input.&lt;br&gt;
The Database&lt;br&gt;
Please modify this as appropriate for your language.&lt;/p&gt;

&lt;p&gt;[ ("english", "Welcome")&lt;br&gt;
, ("czech", "Vitejte")&lt;br&gt;
, ("danish", "Velkomst")&lt;br&gt;
, ("dutch", "Welkom")&lt;br&gt;
, ("estonian", "Tere tulemast")&lt;br&gt;
, ("finnish", "Tervetuloa")&lt;br&gt;
, ("flemish", "Welgekomen")&lt;br&gt;
, ("french", "Bienvenue")&lt;br&gt;
, ("german", "Willkommen")&lt;br&gt;
, ("irish", "Failte")&lt;br&gt;
, ("italian", "Benvenuto")&lt;br&gt;
, ("latvian", "Gaidits")&lt;br&gt;
, ("lithuanian", "Laukiamas")&lt;br&gt;
, ("polish", "Witamy")&lt;br&gt;
, ("spanish", "Bienvenido")&lt;br&gt;
, ("swedish", "Valkommen")&lt;br&gt;
, ("welsh", "Croeso")&lt;br&gt;
]&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function greet(language) {
  const languages = [
    ["english", "Welcome"],
    ["czech", "Vitejte"],
    ["danish", "Velkomst"],
    ["dutch", "Welkom"],
    ["estonian", "Tere tulemast"],
    ["finnish", "Tervetuloa"],
    ["flemish", "Welgekomen"],
    ["french", "Bienvenue"],
    ["german", "Willkommen"],
    ["irish", "Failte"],
    ["italian", "Benvenuto"],
    ["latvian", "Gaidits"],
    ["lithuanian", "Laukiamas"],
    ["polish", "Witamy"],
    ["spanish", "Bienvenido"],
    ["swedish", "Valkommen"],
    ["welsh", "Croeso"]
  ];

  for (let i = 0; i &amp;lt; languages.length; i++) {
    if (languages[i][0] === language) {
      return languages[i][1];
    }
  }
  return languages[0][1];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;1.I decided to store the input into an array. I loop through the array and if the language was found, will return the greeting in the found language. Otherwise will return 'Welcome' as default. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.codewars.com/kata/577ff15ad648a14b780000e7/train/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 8kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>8kyu</category>
    </item>
    <item>
      <title>#1 School Paperwork</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Tue, 08 Jul 2025 20:06:00 +0000</pubDate>
      <link>https://dev.to/maddiepst/1-school-paperwork-1fb8</link>
      <guid>https://dev.to/maddiepst/1-school-paperwork-1fb8</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Your classmates asked you to copy some paperwork for them. You know that there are 'n' classmates and the paperwork has 'm' pages.&lt;/p&gt;

&lt;p&gt;Your task is to calculate how many blank pages do you need. If n &amp;lt; 0 or m &amp;lt; 0 return 0.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
n= 5, m=5: 25&lt;br&gt;
n=-5, m=5:  0&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function paperwork(n, m) {
  if(n&amp;lt;0 || m&amp;lt;0) return 0;
  return n*m;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;1.I do create an if statement to verify any of the conditions imposed by instructions.If any of the conditions are met is returning 0 otherwise the return is m*n.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.codewars.com/kata/55f9b48403f6b87a7c0000bd/train/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 8kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>8kyu</category>
    </item>
    <item>
      <title>Find the capitals</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Mon, 07 Jul 2025 17:32:00 +0000</pubDate>
      <link>https://dev.to/maddiepst/find-the-capitals-2ch5</link>
      <guid>https://dev.to/maddiepst/find-the-capitals-2ch5</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Write a function that takes a single non-empty string of only lowercase and uppercase ascii letters (word) as its argument, and returns an ordered list containing the indices of all capital (uppercase) letters in the string.&lt;/p&gt;

&lt;p&gt;Example (Input --&amp;gt; Output)&lt;br&gt;
"CodEWaRs" --&amp;gt; [0,3,4,6]&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;var capitals = function (word) {
    // Write your code here
  const indexes = [];
  for (let i = 0; i &amp;lt; word.length; i++) {
    if (word[i] === word[i].toUpperCase()) {
      indexes.push(i);
    }
  }
  return indices;
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts:&lt;/em&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;I initialize the indexes as an array and loop through the string word with for loop.&lt;/li&gt;
&lt;li&gt;If the letter ( index of the word) matches the condition, the index will be addes to the indexes array.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://www.codewars.com/kata/539ee3b6757843632d00026b/train/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 7kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>7kyu</category>
    </item>
    <item>
      <title>Break camelCase</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Sun, 06 Jul 2025 17:23:00 +0000</pubDate>
      <link>https://dev.to/maddiepst/break-camelcase-o36</link>
      <guid>https://dev.to/maddiepst/break-camelcase-o36</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Complete the solution so that the function will break up camel casing, using a space between words.&lt;/p&gt;

&lt;p&gt;Example&lt;br&gt;
"camelCasing"  =&amp;gt;  "camel Casing"&lt;br&gt;
"identifier"   =&amp;gt;  "identifier"&lt;br&gt;
""             =&amp;gt;  ""&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function solution(string) {
  return arr = string.split('').map(l =&amp;gt; l !== l.toUpperCase() ? l : ' ' + l).join('');

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;1.I transform the string into an array to be able to iterate easily through each letter/element of the array.&lt;br&gt;
2.I  use the function map in order to go through each letter and transformed it based on the condition: &lt;code&gt;l !==l.toUpperCase()&lt;/code&gt; .If the original letter is not upper case we return the letter as it is, in case it is upper case , we add a space before the upper letter.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;I join the array to a string and return it . &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://www.codewars.com/kata/5208f99aee097e6552000148/train/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 6kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>6kyu</category>
    </item>
    <item>
      <title>What's the real floor?</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Sat, 05 Jul 2025 16:06:00 +0000</pubDate>
      <link>https://dev.to/maddiepst/whats-the-real-floor-25l</link>
      <guid>https://dev.to/maddiepst/whats-the-real-floor-25l</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Americans are odd people: in their buildings, the first floor is actually the ground floor and there is no 13th floor (due to superstition).&lt;/p&gt;

&lt;p&gt;Write a function that given a floor in the american system returns the floor in the european system.&lt;/p&gt;

&lt;p&gt;With the 1st floor being replaced by the ground floor and the 13th floor being removed, the numbers move down to take their place. In case of above 13, they move down by two because there are two omitted numbers below them.&lt;/p&gt;

&lt;p&gt;Basements (negatives) stay the same as the universal level.&lt;/p&gt;

&lt;p&gt;More information here&lt;/p&gt;

&lt;p&gt;Examples&lt;br&gt;
1  =&amp;gt;  0 &lt;br&gt;
0  =&amp;gt;  0&lt;br&gt;
5  =&amp;gt;  4&lt;br&gt;
15  =&amp;gt;  13&lt;br&gt;
-3  =&amp;gt;  -3&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution 1:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getRealFloor(n) {
  if(n &amp;lt;13 &amp;amp;&amp;amp; n&amp;gt;0) return n-1;
  else if(n&amp;gt;=13) return n-2;
  else return n;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Solution 2:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getRealFloor(n) {
  return n &amp;gt; 13 ? n-2 : n &amp;gt; 0 ? n-1 : n
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts:&lt;/em&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Just an easy if else function that returns different numbers based on conditions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;I use ternary operator for Solution 2 which do exactly the same.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://www.codewars.com/kata/574b3b1599d8f897470018f6/train/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 8kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>8kyu</category>
    </item>
    <item>
      <title>Filter out the geese</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Fri, 04 Jul 2025 15:54:00 +0000</pubDate>
      <link>https://dev.to/maddiepst/filter-out-the-geese-15mo</link>
      <guid>https://dev.to/maddiepst/filter-out-the-geese-15mo</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Write a function that takes a list of strings as an argument and returns a filtered list containing the same elements but with the 'geese' removed.&lt;/p&gt;

&lt;p&gt;The geese are any strings in the following array, which is pre-populated in your solution:&lt;/p&gt;

&lt;p&gt;["African", "Roman Tufted", "Toulouse", "Pilgrim", "Steinbacher"]&lt;br&gt;
For example, if this array were passed as an argument:&lt;/p&gt;

&lt;p&gt;["Mallard", "Hook Bill", "African", "Crested", "Pilgrim", "Toulouse", "Blue Swedish"]&lt;br&gt;
Your function would return the following array:&lt;/p&gt;

&lt;p&gt;["Mallard", "Hook Bill", "Crested", "Blue Swedish"]&lt;br&gt;
The elements in the returned array should be in the same order as in the initial array passed to your function, albeit with the 'geese' removed. Note that all of the strings will be in the same case as those provided, and some elements may be repeated.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function gooseFilter(birds) {
  var geese = ["African", "Roman Tufted", "Toulouse", "Pilgrim", "Steinbacher"];
  const newBirds = birds.filter((bird) =&amp;gt; !geese.includes(bird));
  return newBirds;
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts:&lt;/em&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;After I define the geese, I filter the birds to return only the ones that do not match with any of the geese elements&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://www.codewars.com/kata/57ee4a67108d3fd9eb0000e7/solutions/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 8kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>8kyu</category>
    </item>
    <item>
      <title>Remove the minimum</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Thu, 03 Jul 2025 15:50:00 +0000</pubDate>
      <link>https://dev.to/maddiepst/remove-the-minimum-967</link>
      <guid>https://dev.to/maddiepst/remove-the-minimum-967</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;The museum of incredibly dull things wants to get rid of some exhibits. Miriam, the interior architect, comes up with a plan to remove the most boring exhibits. She gives them a rating, and then removes the one with the lowest rating.&lt;/p&gt;

&lt;p&gt;However, just as she finished rating all exhibits, she's off to an important fair, so she asks you to write a program that tells her the ratings of the exhibits after removing the lowest one. Fair enough.&lt;/p&gt;

&lt;p&gt;Task&lt;br&gt;
Given an array of integers, remove the smallest value. Do not mutate the original array/list. If there are multiple elements with the same value, remove the one with the lowest index. If you get an empty array/list, return an empty array/list.&lt;/p&gt;

&lt;p&gt;Don't change the order of the elements that are left.&lt;/p&gt;

&lt;p&gt;Examples&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Input: [1,2,3,4,5], output = [2,3,4,5]&lt;/li&gt;
&lt;li&gt;Input: [5,3,2,1,4], output = [5,3,2,4]&lt;/li&gt;
&lt;li&gt;Input: [2,2,1,2,1], output = [2,2,2,1]&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function removeSmallest(numbers) {
  const num = [...numbers]
  const min = Math.min(...num);
  num.splice(num.indexOf(min), 1);
  return num;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;1.I do create a new copy of the original array named num, so it will not modify the original one.&lt;br&gt;
2.I find the min number of the array, the index of the min number and I remove the min number from it. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.codewars.com/kata/563cf89eb4747c5fb100001b/train/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 7kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>7kyu</category>
    </item>
    <item>
      <title>Detect Pangram</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Wed, 02 Jul 2025 15:00:00 +0000</pubDate>
      <link>https://dev.to/maddiepst/detect-pangram-4ie8</link>
      <guid>https://dev.to/maddiepst/detect-pangram-4ie8</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;A pangram is a sentence that contains every single letter of the alphabet at least once. For example, the sentence "The quick brown fox jumps over the lazy dog" is a pangram, because it uses the letters A-Z at least once (case is irrelevant).&lt;/p&gt;

&lt;p&gt;Given a string, detect whether or not it is a pangram. Return True if it is, False if not. Ignore numbers and punctuation.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Try 1:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function isPangram(string) {
  const alphabet = [
    "a",
    "b",
    "c",
    "d",
    "e",
    "f",
    "g",
    "h",
    "i",
    "j",
    "k",
    "l",
    "m",
    "n",
    "o",
    "p",
    "q",
    "r",
    "s",
    "t",
    "u",
    "v",
    "w",
    "x",
    "y",
    "z",
  ];
  const newArray = [...new Set(string.toLowerCase().split(""))];
  const index1 = newArray.indexOf(" ");
  if (index1 !== -1) newArray.splice(index1, 1);
  const index2 = newArray.indexOf(".");
  if (index2 !== -1) newArray.splice(index2, 1);

  return newArray.length === alphabet.length ? true : false;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts 1:&lt;/em&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;I do split the string into an array of letters and store it in a set type, so I will only have unique letters.I store everything into the newArray variable.&lt;/li&gt;
&lt;li&gt;I identify the indexes of the space(' ') and period('.') punctuation and delete them from the array.&lt;/li&gt;
&lt;li&gt;Finally, I do compare the length of the newArray with the alphabet length. Taking into account that each letter in the new array is unique, if the lengths are equal results the string is a pangram.
4.The solution above was my 1st try to solve the challenge and does not work.
### &lt;em&gt;Solution:&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function isPangram(string) {
  const alphabet = [
    "a",
    "b",
    "c",
    "d",
    "e",
    "f",
    "g",
    "h",
    "i",
    "j",
    "k",
    "l",
    "m",
    "n",
    "o",
    "p",
    "q",
    "r",
    "s",
    "t",
    "u",
    "v",
    "w",
    "x",
    "y",
    "z",
  ];
   const newArr = [...new Set(string.toLowerCase().split(""))]
    .filter(
      (letter) =&amp;gt;
        letter !== " " &amp;amp;&amp;amp;
        letter !== "." &amp;amp;&amp;amp;
        letter !== "," &amp;amp;&amp;amp;
        isNaN(Number(letter))
    );

  return newArr.length === alphabet.length ? true : false;

}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts 2:&lt;/em&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;I have modify my function to include numbers and to eliminate my errors.&lt;/li&gt;
&lt;li&gt;I do split the string into an array of letters and store it in a set type, so I will only have unique letters. I store everything into the newArr variable. Then filter the resulted array, making sure they respect all the conditions, no punctuation or numbers.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.filter(
      (letter) =&amp;gt;
        letter !== " " &amp;amp;&amp;amp;
        letter !== "." &amp;amp;&amp;amp;
        letter !== "," &amp;amp;&amp;amp;
        isNaN(Number(letter))
    );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Finally, I do compare the length of the newArray with the alphabet length. Taking into account that each letter in the new array is unique, if the lengths are equal results the string is a pangram.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://www.codewars.com/kata/545cedaa9943f7fe7b000048/train/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 6kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>6kyu</category>
    </item>
    <item>
      <title>Parse nice int from char problem</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Tue, 01 Jul 2025 13:02:00 +0000</pubDate>
      <link>https://dev.to/maddiepst/parse-nice-int-from-char-problem-4mp6</link>
      <guid>https://dev.to/maddiepst/parse-nice-int-from-char-problem-4mp6</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;You ask a small girl,"How old are you?" She always says, "x years old", where x is a random number between 0 and 9.&lt;/p&gt;

&lt;p&gt;Write a program that returns the girl's age (0-9) as an integer.&lt;/p&gt;

&lt;p&gt;Assume the test input string is always a valid string. For example, the test input may be "1 year old" or "5 years old". The first character in the string is always a number.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;First I want to isolate the 1st string element,since is always a number.After this, I transform it into a number.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getAge(inputString){
// return the girl's correct age as an integer. Happy coding :) 
  return Number(inputString[0]);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://www.codewars.com/kata/557cd6882bfa3c8a9f0000c1/train/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 8kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>8kyu</category>
    </item>
    <item>
      <title>Reverse List Order</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Tue, 01 Jul 2025 00:54:49 +0000</pubDate>
      <link>https://dev.to/maddiepst/reverse-list-order-7e3</link>
      <guid>https://dev.to/maddiepst/reverse-list-order-7e3</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;In this kata you will create a function that takes in a list and returns a list with the reverse order.&lt;/p&gt;

&lt;p&gt;Examples (Input -&amp;gt; Output)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[1, 2, 3, 4]  -&amp;gt; [4, 3, 2, 1]&lt;/li&gt;
&lt;li&gt;[9, 2, 0, 7]  -&amp;gt; [7, 0, 2, 9]&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;For this requirement arrays has the reverse() method, that reverse the array/list.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function reverseList(list) {
  return list.reverse();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://www.codewars.com/kata/53da6d8d112bd1a0dc00008b/train/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 8kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>8kyu</category>
    </item>
    <item>
      <title>Are they the "same"?</title>
      <dc:creator>Madalina Pastiu</dc:creator>
      <pubDate>Tue, 03 Jun 2025 04:00:00 +0000</pubDate>
      <link>https://dev.to/maddiepst/are-they-the-same-57ai</link>
      <guid>https://dev.to/maddiepst/are-they-the-same-57ai</guid>
      <description>&lt;h3&gt;
  
  
  &lt;em&gt;Instructions:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Given two arrays a and b write a function comp(a, b) (orcompSame(a, b)) that checks whether the two arrays have the "same" elements, with the same multiplicities (the multiplicity of a member is the number of times it appears). "Same" means, here, that the elements in b are the elements in a squared, regardless of the order.&lt;/p&gt;

&lt;p&gt;Examples&lt;br&gt;
Valid arrays&lt;br&gt;
a = [121, 144, 19, 161, 19, 144, 19, 11]&lt;br&gt;&lt;br&gt;
b = [121, 14641, 20736, 361, 25921, 361, 20736, 361]&lt;br&gt;
comp(a, b) returns true because in b 121 is the square of 11, 14641 is the square of 121, 20736 the square of 144, 361 the square of 19, 25921 the square of 161, and so on. It gets obvious if we write b's elements in terms of squares:&lt;/p&gt;

&lt;p&gt;a = [121, 144, 19, 161, 19, 144, 19, 11] &lt;br&gt;
b = [11*11, 121*121, 144*144, 19*19, 161*161, 19*19, 144*144, 19*19]&lt;br&gt;
Invalid arrays&lt;br&gt;
If, for example, we change the first number to something else, comp is not returning true anymore:&lt;/p&gt;

&lt;p&gt;a = [121, 144, 19, 161, 19, 144, 19, 11]&lt;br&gt;&lt;br&gt;
b = [132, 14641, 20736, 361, 25921, 361, 20736, 361]&lt;br&gt;
comp(a,b) returns false because in b 132 is not the square of any number of a.&lt;/p&gt;

&lt;p&gt;a = [121, 144, 19, 161, 19, 144, 19, 11]&lt;br&gt;&lt;br&gt;
b = [121, 14641, 20736, 36100, 25921, 361, 20736, 361]&lt;br&gt;
comp(a,b) returns false because in b 36100 is not the square of any number of a.&lt;/p&gt;

&lt;p&gt;Remarks&lt;br&gt;
a or b might be [] or {} (all languages except R, Shell).&lt;br&gt;
a or b might be nil or null or None or nothing (except in C++, COBOL, Crystal, D, Dart, Elixir, Fortran, F#, Haskell, Nim, OCaml, Pascal, Perl, PowerShell, Prolog, PureScript, R, Racket, Rust, Shell, Swift).&lt;br&gt;
If a or b are nil (or null or None, depending on the language), the problem doesn't make sense so return false.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts 1:&lt;/em&gt;
&lt;/h3&gt;

&lt;p&gt;Initially, I approached the problem by checking if each number from the first array, when squared, exists in the second array. However, during submission, I encountered errors that made me realise the importance of accounting for multiplicity. Specifically, after matching a squared value from the first array in the second array, I need to remove it from the second array to prevent it from being matched again incorrectly.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution 1:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function comp(array1, array2) {
  const arrValue = array2.includes(Math.pow(a,2));
  if (compare.includes(false)) console.log(false);
  else console.log(true);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;em&gt;Thoughts 2:&lt;/em&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;In this solution, I started by checking if either input array is null, as the problem specifies that in such cases we should return false.&lt;/li&gt;
&lt;li&gt;Then, for each element in array1, I calculated its square, checked if the square exists in array2 and if it does, I removed that specific squared value from array2 using splice to ensure proper handling of duplicate values (i.e., correct multiplicity).&lt;/li&gt;
&lt;li&gt;I collected the result of each comparison in a new array called compare. If any element from array1 did not have a matching square in array2, the final result is false. Otherwise, if all elements matched correctly, I return true.&lt;/li&gt;
&lt;li&gt;This logic ensures that: 

&lt;ul&gt;
&lt;li&gt;The multiplicities are respected.&lt;/li&gt;
&lt;li&gt;The order of elements doesn’t matter.&lt;/li&gt;
&lt;li&gt;Only valid matches are considered, with used elements 
 removed to avoid false positives.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;em&gt;Solution 2:&lt;/em&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function comp(array1, array2){
 if( array1 === null || array2 ===null) return false;
 const compare = array1.map(a =&amp;gt;{  
  function removeIndex(){
    var index = array2.indexOf(Math.pow(a,2));
    if (index !== -1) array2.splice(index, 1);
  }
  const arrValue = array2.includes(Math.pow(a,2));
  if(arrValue === true) removeIndex();
  return arrValue;
  });
  if(compare.includes(false)) return false;
  else return true;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://www.codewars.com/kata/550498447451fbbd7600041c/train/javascript" rel="noopener noreferrer"&gt;This is a CodeWars Challenge of 6kyu Rank&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>challenge</category>
      <category>codewars</category>
      <category>6kyu</category>
    </item>
  </channel>
</rss>
