<?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: Sharmin Shanta</title>
    <description>The latest articles on DEV Community by Sharmin Shanta (@sharminshanta).</description>
    <link>https://dev.to/sharminshanta</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%2F2162997%2Fd459f2b9-cc09-45f1-bfd6-acdac6bbf050.jpg</url>
      <title>DEV Community: Sharmin Shanta</title>
      <link>https://dev.to/sharminshanta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sharminshanta"/>
    <language>en</language>
    <item>
      <title>Service Discovery in Distributed Systems: Through service discovery in distributed systems, all service consumers can communicate with service providers easily by knowing the exact locations stored in the service registry.</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Thu, 10 Jul 2025 14:44:24 +0000</pubDate>
      <link>https://dev.to/sharminshanta/service-discovery-in-distributed-systems-through-service-discovery-in-distributed-systems-all-3iok</link>
      <guid>https://dev.to/sharminshanta/service-discovery-in-distributed-systems-through-service-discovery-in-distributed-systems-all-3iok</guid>
      <description></description>
      <category>distributedsystems</category>
      <category>systemdesign</category>
      <category>networking</category>
      <category>microservices</category>
    </item>
    <item>
      <title>What are L, R, K, and N in an array?</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Wed, 18 Dec 2024 17:38:43 +0000</pubDate>
      <link>https://dev.to/sharminshanta/what-are-l-and-r-in-an-array-28mb</link>
      <guid>https://dev.to/sharminshanta/what-are-l-and-r-in-an-array-28mb</guid>
      <description>&lt;p&gt;In different contexts, "L" and "R" can represent different things, such as indices, values, or operations. Below are some common interpretations:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. L and R as Indices in an Array:&lt;/strong&gt;&lt;br&gt;
If you are working with an array and you encounter "L" and "R", they might represent the left index (L) and the right index (R) of a subarray, often used in range-related problems. For example:&lt;br&gt;
L = 0 (leftmost index)&lt;br&gt;
R = n-1 (rightmost index, where n is the length of the array)&lt;br&gt;
These indices are commonly used in problems like:&lt;br&gt;
Subarray sum: Sum of elements between indices L and R.&lt;br&gt;
Search: Binary search or range queries between indices L and R.&lt;br&gt;
Divide and conquer algorithms that break an array into parts from L to R.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. L and R as Partitioning Values:&lt;/strong&gt;&lt;br&gt;
In problems like &lt;strong&gt;QuickSort&lt;/strong&gt;, "L" and "R" might refer to pivot values or ranges where the array is being split into two parts. This is common in partitioning logic:&lt;br&gt;
L could be the "low" value.&lt;br&gt;
R could be the "high" value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. L and R as Operations:&lt;/strong&gt;&lt;br&gt;
If you have an array, "L" and "R" could also represent certain operations to apply within the array. For example:&lt;br&gt;
L could stand for "Left Shift" (shift elements to the left).&lt;br&gt;
R could stand for "Right Shift" (shift elements to the right).&lt;/p&gt;

&lt;p&gt;Simple Code Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function permute($str, $l, $r)
{
    if ($l == $r)
        echo $str. "\n";
    else {
        for ($i = $l; $i &amp;lt;= $r; $i++) {
            $str = swap($str, $l, $i);
            permute($str, $l + 1, $r);
            $str = swap($str, $l, $i);
        }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To solve this permutation problem, I thought that need to demonstrate the keywords that are used many times in an array.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"K" and "N"&lt;/strong&gt;&lt;br&gt;
K refers to the value searched for and N refers to the size of the array. Moreover, the terms "K" and "N" in the context of an array can be referred to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;K and N as indices in an array (e.g., accessing elements at the K-th and N-th positions)&lt;/li&gt;
&lt;li&gt;K and N as specific values within the array (e.g., looking for occurrences of K and N)&lt;/li&gt;
&lt;li&gt;A problem involving K and N in arrays (such as sorting, searching, or comparisons)&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>Evaluation of Software Architecture</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Sat, 14 Dec 2024 17:26:22 +0000</pubDate>
      <link>https://dev.to/sharminshanta/evaluation-of-software-architecture-5030</link>
      <guid>https://dev.to/sharminshanta/evaluation-of-software-architecture-5030</guid>
      <description>&lt;p&gt;&lt;a href="https://www.linkedin.com/posts/activity-7273746316512374784-W1Br?utm_source=share&amp;amp;utm_medium=member_desktop" rel="noopener noreferrer"&gt;https://www.linkedin.com/posts/activity-7273746316512374784-W1Br?utm_source=share&amp;amp;utm_medium=member_desktop&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Free APIs for study and practice</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Sat, 14 Dec 2024 12:00:36 +0000</pubDate>
      <link>https://dev.to/sharminshanta/free-apis-for-study-and-practice-m7b</link>
      <guid>https://dev.to/sharminshanta/free-apis-for-study-and-practice-m7b</guid>
      <description>&lt;p&gt;Application Programming Interfaces, the acronym APIs, are used in web applications for various purposes. The facilities of APIs in the modern edge are:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Connect Applications:&lt;/strong&gt;&lt;br&gt;
APIs act as a bridge among different software applications, allowing them to communicate and exchange data. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enable Interactions:&lt;/strong&gt;&lt;br&gt;
APIs allow business applications to interact with external services, databases, and other systems. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Support HTTP/s Protocol:&lt;/strong&gt;&lt;br&gt;
Web APIs support HTTP/s protocol and URL request headers, which enable services to reach various clients through the web. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Provide Flexibility:&lt;/strong&gt;&lt;br&gt;
Web APIs provide flexibility to any style of communication. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Integrate with third-party Services:&lt;/strong&gt;&lt;br&gt;
A web API can allow a web server to interact with third-party services.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create Simple Development Process:&lt;/strong&gt;&lt;br&gt;
APIs make the development process Simple for both the web application firm and others. &lt;/p&gt;

&lt;p&gt;There are some free APIs, that help us to guide about APIs for many purposes such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How APIs work, what structure it is, and authentication &amp;amp; authorization of API.&lt;/li&gt;
&lt;li&gt;How we can send the Error Message if any call is invalid OR doesn't meet the required parameters, and get know HTTP status code.&lt;/li&gt;
&lt;li&gt;How many calls we can send to an API endpoint per hour in a day - The technical word is Rate Limit.&lt;/li&gt;
&lt;li&gt;How we can exchange the high-scale data - Pagination, Cache, and so on. &lt;/li&gt;
&lt;li&gt;How we can write up better documentation that guides the client to use it. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Feel free to check it out - &lt;a href="https://dev.to/hanzla-baig/100-free-apis-for-developers-in-2024-1jfi"&gt;https://dev.to/hanzla-baig/100-free-apis-for-developers-in-2024-1jfi&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Linear Search in PHP</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Fri, 13 Dec 2024 20:43:26 +0000</pubDate>
      <link>https://dev.to/sharminshanta/linear-search-in-php-4ke8</link>
      <guid>https://dev.to/sharminshanta/linear-search-in-php-4ke8</guid>
      <description>&lt;p&gt;The easiest DSA algorithm (Data Structure and Algorithm) is Linear Search. It's simple to implement and doesn't require the data to be in any specific order. &lt;/p&gt;

&lt;p&gt;Algorithm:&lt;br&gt;
a. Loop that goes through the array from start to end.&lt;br&gt;
b. Compares the current value with the target value, and returns the current index if the target value is found.&lt;br&gt;
c. End of the loop, return -1, cause of not finding the target value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
 * Linear Search: The Linear Search algorithm searches through an array and returns the index of the value it searches for.
 * It starts from the first element of the array
 *
 * @param array $arr
 * @param int $targetVal
 * @return int
 */
function linearSearch(array $arr, int $targetVal): int
{
    for ($i = 0; $i &amp;lt; count($arr); $i++) {
        if ($arr[$i] == $targetVal) {
            return $i;
        }
    }

    return -1;
}

$arr = [2, 7, 9, 30, 5];
print_r(linearSearch($arr, 5)); // output: 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Find out the GCD(Greatest Common Divisor) of the given two numbers in PHP.</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Fri, 13 Dec 2024 16:59:40 +0000</pubDate>
      <link>https://dev.to/sharminshanta/find-out-the-gcdgreatest-common-divisor-of-the-given-two-numbers-in-php-3l2</link>
      <guid>https://dev.to/sharminshanta/find-out-the-gcdgreatest-common-divisor-of-the-given-two-numbers-in-php-3l2</guid>
      <description>&lt;p&gt;It's a manual process to find out the GCD of given two numbers that we've learned in our childhood in general mathematics on standard 2/3.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function getGCD($num1, $num2) {

    if ($num1 == 0 || $num2 == 0)
        return false;

    $divisor = $num1;
    $dividend = $num2;

    if ($num1 &amp;gt; $num2) {
        $divisor = $num2;
        $dividend = $num1;
    }

    $remainder = $dividend % $divisor;
    $quotient = $dividend / $divisor;

    if ($remainder !== 0) {
        $result = $remainder;
    } else {
        $result = $quotient;
    }

    return $result;
}

print_r(getGCD(12, 16)); // Output: 4
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Anagram in PHP</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Thu, 12 Dec 2024 14:21:37 +0000</pubDate>
      <link>https://dev.to/sharminshanta/anagram-in-php-19on</link>
      <guid>https://dev.to/sharminshanta/anagram-in-php-19on</guid>
      <description>&lt;div class="ltag__link"&gt;
  &lt;a href="/sharminshanta" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__pic"&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2162997%2Fd459f2b9-cc09-45f1-bfd6-acdac6bbf050.jpg" alt="sharminshanta"&gt;
    &lt;/div&gt;
  &lt;/a&gt;
  &lt;a href="https://dev.to/sharminshanta/check-whether-a-given-string-is-an-anagram-of-another-given-string-lc" class="ltag__link__link"&gt;
    &lt;div class="ltag__link__content"&gt;
      &lt;h2&gt;Check whether a given string is an anagram of another given string.&lt;/h2&gt;
      &lt;h3&gt;Sharmin Shanta ・ Dec 12 '24&lt;/h3&gt;
      &lt;div class="ltag__link__taglist"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/a&gt;
&lt;/div&gt;


</description>
    </item>
    <item>
      <title>Check whether a given string is an anagram of another given string.</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Thu, 12 Dec 2024 13:40:16 +0000</pubDate>
      <link>https://dev.to/sharminshanta/check-whether-a-given-string-is-an-anagram-of-another-given-string-lc</link>
      <guid>https://dev.to/sharminshanta/check-whether-a-given-string-is-an-anagram-of-another-given-string-lc</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/**
 * Check if a word is an anagram of another word
 *   Break Down the Problem:
 *   a. Checking length of two given strings - return false if it doesn't match the length
 *   b. Mapping characters between two strings - Checking same char in two strings
 *   c. Counting for each character found - Same char, but checking occurrence is same between two strings
 *   d. Comparing each character count between two strings - if char and char count are same
 *
 * @param string $str1
 * @param string $str2
 * @return false|string
 */
function checkAnagram(string $str1, string $str2)
{
    $msg = '';

    try {
        $str1Count = strlen($str1);
        $str2Count = strlen($str2);

        if ($str1Count !== $str2Count) {
            return false;
        }

        $strOne = $strTwo = [];
        for ($i = 0; $i &amp;lt; $str1Count; $i++) {
            if (isset($strOne[$str1[$i]])) {
                $strOne[$str1[$i]]++;
            } else {
                $strOne[$str1[$i]] = 1;
            }

            if (isset($strTwo[$str2[$i]])) {
                $strTwo[$str2[$i]]++;
            } else {
                $strTwo[$str2[$i]] = 1;
            }
        }

        foreach ($strOne as $char =&amp;gt; $count) {
            if (! isset($strTwo[$char]) || $count !== $strTwo[$char]) {
                throw new Exception("This word {$str1} is not anagram of {$str2}.");
            } else {
                $msg = "This word {$str1} is anagram of {$str2}.";
            }
        }
    } catch (Exception $ex) {
       $msg = $ex-&amp;gt;getMessage();
    }

    return $msg;
}

/**
 * It doesn't match, why?
 * a. String length is same for given two string
 * b. Char are same in two strings
 * c. But count of char occurrence isn't same- 'c' two times in str1, and 'c' one time in str2
 * d. For matching: Just try 'act' with the word 'cat'
 */
print_r(checkAnagram('acct', 'caat'));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>What is Anagram?</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Thu, 12 Dec 2024 10:25:31 +0000</pubDate>
      <link>https://dev.to/sharminshanta/what-is-anagram-99p</link>
      <guid>https://dev.to/sharminshanta/what-is-anagram-99p</guid>
      <description>&lt;p&gt;&lt;strong&gt;Anagram&lt;/strong&gt; is a word OR phrase formed by the letters of the word OR phrase, generally using the letters exactly once. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For example:&lt;/strong&gt; The word &lt;strong&gt;'act'&lt;/strong&gt;, when we rearrange it, would be &lt;strong&gt;'cat'&lt;/strong&gt;. The 'cat' is another word based on the main word 'act'. The two words have the same letters and the same string length. Only we have changed the letter position and made a new word with the exact length.&lt;/p&gt;

&lt;p&gt;We can say that an &lt;strong&gt;Anagram&lt;/strong&gt; is rearranging the given word that makes another word.&lt;br&gt;
'cork' =&amp;gt; 'rock'&lt;br&gt;
'gum' =&amp;gt; 'mug'&lt;br&gt;
'note' =&amp;gt; 'tone'&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Sort an array in PHP</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Wed, 04 Dec 2024 13:06:01 +0000</pubDate>
      <link>https://dev.to/sharminshanta/sort-an-array-in-php-eca</link>
      <guid>https://dev.to/sharminshanta/sort-an-array-in-php-eca</guid>
      <description>&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$arr['one'] = 1;
$arr['three'] = 3;
$arr['four'] = 4;
$arr['two'] = 2;
$arr['five'] = 5;

sort($arr); // sort the value as ascending order and return the new array: [0 =&amp;gt; 1, 1 =&amp;gt; 2, ...]
rsort($arr); // sort the value as descending order and return the new array: [0 =&amp;gt; 5, 1 =&amp;gt; 4, ...]
asort($arr); // sort the value as ascending order and return the array with the actual key: ['one' =&amp;gt; 1, 'two =&amp;gt; 2, ...]
arsort($arr); // sort the value as descending order and return the array with the actual key: ['five' =&amp;gt; 5, 'four =&amp;gt; 4, ...]
ksort($arr); // sort the key as ascending order and return the array with the actual value: ['five' =&amp;gt; 5, 'four =&amp;gt; 4, 'one' =&amp;gt; 1, ...]
krsort($arr); // sort the key as descending order and return the array with the actual value: ['two' =&amp;gt; 2, 'three' =&amp;gt; 3, 'one' =&amp;gt; 1, ...]

print_r($arr);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Variadic Function in PHP</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Wed, 04 Dec 2024 12:28:44 +0000</pubDate>
      <link>https://dev.to/sharminshanta/variadic-function-in-php-49c1</link>
      <guid>https://dev.to/sharminshanta/variadic-function-in-php-49c1</guid>
      <description>&lt;p&gt;A variadic function is a function that accepts a variable number of arguments with three dots(...) called the spread operator before the function parameter. A function can have many parameters, but sometimes It isn't easy to maintain. For this reason, PHP has the facility to use the variadic function. This type of parameter should be the last variable parameter in the function signature. It returns in the function as an array.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?PHP

/**
 * @param $var1
 * @param $var2
 * @param ...$array
 * @return array
 */
function variadicFun($var1, $var2, ...$array)
{
    return $array;
}

print_r(variadicFun('name', 'age', 'Devid', 'Gilmour', 'Shwan'));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>Time Complexity</title>
      <dc:creator>Sharmin Shanta</dc:creator>
      <pubDate>Mon, 25 Nov 2024 17:12:05 +0000</pubDate>
      <link>https://dev.to/sharminshanta/time-complexity-1ne0</link>
      <guid>https://dev.to/sharminshanta/time-complexity-1ne0</guid>
      <description>&lt;p&gt;We encounter frequently the term &lt;strong&gt;Time Complexity,&lt;/strong&gt; while learning the &lt;strong&gt;Data Structure and Algorithm&lt;/strong&gt;. It is the fundamental concept of computer science and refers to insights into How long an algorithm takes to complete given a certain input size.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Time complexity&lt;/strong&gt; represents the amount of time an algorithm takes to run as a function of the length of the input and provides an upper bound on the running time, helping us understand the worst-case scenario in terms of performance.&lt;/p&gt;

</description>
      <category>timecomplexity</category>
    </item>
  </channel>
</rss>
