<?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: Teja</title>
    <description>The latest articles on DEV Community by Teja (@saiteja_amshala_035a7d7f1).</description>
    <link>https://dev.to/saiteja_amshala_035a7d7f1</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%2F1743651%2F26016bca-e53e-46fa-9e3d-77dd94a21ed0.png</url>
      <title>DEV Community: Teja</title>
      <link>https://dev.to/saiteja_amshala_035a7d7f1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saiteja_amshala_035a7d7f1"/>
    <language>en</language>
    <item>
      <title>30 Days of Code HackerRank using JAVASCRIPT DAY 2 : Operators</title>
      <dc:creator>Teja</dc:creator>
      <pubDate>Sat, 13 Jul 2024 05:07:54 +0000</pubDate>
      <link>https://dev.to/saiteja_amshala_035a7d7f1/30-days-of-code-hackerrank-using-javascript-day-2-operators-2do1</link>
      <guid>https://dev.to/saiteja_amshala_035a7d7f1/30-days-of-code-hackerrank-using-javascript-day-2-operators-2do1</guid>
      <description>&lt;p&gt;&lt;strong&gt;Task&lt;/strong&gt;&lt;br&gt;
Given the meal price (base cost of a meal), tip percent (the percentage of the meal price being added as tip), and tax percent (the percentage of the meal price being added as tax) for a meal, find and print the meal's total cost. Round the result to the nearest integer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;meal cost = 100&lt;br&gt;
tip percentage = 15&lt;br&gt;
tax percentage = 8&lt;br&gt;
A tip of 15% * 100 = 15, and the taxes are 8% * 100 = 8. Print the value 123 and return from the function.&lt;/p&gt;

&lt;p&gt;Function Description&lt;br&gt;
Complete the solve function in the editor below.&lt;/p&gt;

&lt;p&gt;solve has the following parameters:&lt;/p&gt;

&lt;p&gt;int meal_cost: the cost of food before tip and tax&lt;br&gt;
int tip_percent: the tip percentage&lt;br&gt;
int tax_percent: the tax percentage&lt;br&gt;
Returns The function returns nothing. Print the calculated value, rounded to the nearest integer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SOLUTION&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9gdwhx2u26hh53zm8xz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi9gdwhx2u26hh53zm8xz.png" alt="Image description" width="800" height="187"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>programming</category>
    </item>
    <item>
      <title>HackerRank 3 Months Preparation Kit(JavaScript) - Mini-Max Sum</title>
      <dc:creator>Teja</dc:creator>
      <pubDate>Mon, 08 Jul 2024 06:03:56 +0000</pubDate>
      <link>https://dev.to/saiteja_amshala_035a7d7f1/hackerrank-3-months-preparation-kitjavascript-mini-max-sum-4k3j</link>
      <guid>https://dev.to/saiteja_amshala_035a7d7f1/hackerrank-3-months-preparation-kitjavascript-mini-max-sum-4k3j</guid>
      <description>&lt;p&gt;Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers.&lt;br&gt;
&lt;strong&gt;Example&lt;/strong&gt;&lt;br&gt;
arr=[1,3,5,7,9]&lt;/p&gt;

&lt;p&gt;The minimum sum is 1+3+5+7 = 16 and the maximum sum is 3+5+7+9 = 24. The function prints 16 24.&lt;/p&gt;

&lt;p&gt;We will be discussing two methods to solve this; &lt;/p&gt;

&lt;p&gt;one is using the sort() method.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5wzn2pdmts0z9ywvcei.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fg5wzn2pdmts0z9ywvcei.png" alt="Image description" width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here in the above method the time complexity will be "O(nlogn)" due to sort() method. To make the time complexity better, the optimized code is given below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspo3ukka0y49d996tcxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fspo3ukka0y49d996tcxi.png" alt="Image description" width="800" height="629"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This code above has only one for loop and hence the time complexity is O(n).&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>HackerRank 3 Months Preparation Kit(JavaScript) - Plus Minus</title>
      <dc:creator>Teja</dc:creator>
      <pubDate>Mon, 08 Jul 2024 01:52:07 +0000</pubDate>
      <link>https://dev.to/saiteja_amshala_035a7d7f1/hackerrank-3-months-preparation-kit-plus-minus-3cgn</link>
      <guid>https://dev.to/saiteja_amshala_035a7d7f1/hackerrank-3-months-preparation-kit-plus-minus-3cgn</guid>
      <description>&lt;p&gt;Given an array of integers, calculate the ratios of its elements that are positive, negative, and zero. Print the decimal value of each fraction on a new line with &lt;em&gt;6&lt;/em&gt; places after the decimal.&lt;br&gt;
Note: This challenge introduces precision problems. The test cases are scaled to six decimal places, though answers with absolute error of up to 10 to the power -4 are acceptable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example&lt;/strong&gt;&lt;br&gt;
arr = [1,1,0,-1,-1]&lt;br&gt;
There are n = 5 elements, two positive, two negative and one zero. Their ratios are 2/5, 2/5 and 1/5. Results are printed as:&lt;br&gt;
0.400000&lt;br&gt;
0.400000&lt;br&gt;
0.200000&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function Description&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Complete the plusMinus function in the editor below.&lt;/p&gt;

&lt;p&gt;plusMinus has the following parameter(s):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;int arr[n]: an array of integers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Print&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Print the ratios of positive, negative and zero values in the array. Each value should be printed on a separate line with 6 digits after the decimal. The function should not return a value.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Input Format&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first line contains an integer, n, the size of the array.&lt;br&gt;
The second line contains n space-separated integers that describe &lt;em&gt;arr[n]&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SOLUTION&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xml9qei0kyajnsjg6ys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xml9qei0kyajnsjg6ys.png" alt="Image description" width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>30 Days of Code HackerRank using JAVASCRIPT DAY 1</title>
      <dc:creator>Teja</dc:creator>
      <pubDate>Sun, 07 Jul 2024 20:01:36 +0000</pubDate>
      <link>https://dev.to/saiteja_amshala_035a7d7f1/30-days-of-code-hackerrank-using-javascript-day-1-3cm5</link>
      <guid>https://dev.to/saiteja_amshala_035a7d7f1/30-days-of-code-hackerrank-using-javascript-day-1-3cm5</guid>
      <description>&lt;p&gt;Objective&lt;br&gt;
Today, we're discussing data types. Check out the Tutorial tab for learning materials and an instructional video!&lt;/p&gt;

&lt;p&gt;Task&lt;br&gt;
Complete the code in the editor below. The variables i, d, and s are already declared and initialized for you. You must:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Declare 3 variables: one of type int, one of type double, and one of type String.&lt;/li&gt;
&lt;li&gt;Read 3 lines of input from stdin (according to the sequence given in the Input Format section below) and initialize your  variables.&lt;/li&gt;
&lt;li&gt;Use the + operator to perform the following operations:

&lt;ol&gt;
&lt;li&gt;Print the sum of i plus your int variable on a new line.&lt;/li&gt;
&lt;li&gt;Print the sum of d plus your double variable to a scale of one 
decimal place on a new line.&lt;/li&gt;
&lt;li&gt;Concatenate s with the string you read as input and print the result on a new line.
&lt;strong&gt;Note:&lt;/strong&gt; If you are using a language that doesn't support using + for string concatenation (e.g.: C), you can just print one variable immediately following the other on the same line. The string provided in your editor must be printed first, immediately followed by the string you read as input.&lt;/li&gt;
&lt;/ol&gt;


&lt;/li&gt;

&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Input Format&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The first line contains an integer that you must sum with i.&lt;br&gt;
The second line contains a double that you must sum with d.&lt;br&gt;
The third line contains a string that you must concatenate with s.&lt;/p&gt;

&lt;p&gt;Output Format&lt;/p&gt;

&lt;p&gt;Print the sum of both integers on the first line, the sum of both doubles (scaled to 1 decimal place) on the second line, and then the two concatenated strings on the third line.&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Sample Input&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
12&lt;br&gt;
4.0&lt;br&gt;
is the best place to learn and practice coding!&lt;/p&gt;

&lt;p&gt;*&lt;em&gt;Sample Output&lt;br&gt;
*&lt;/em&gt;&lt;br&gt;
16&lt;br&gt;
8.0&lt;br&gt;
HackerRank is the best place to learn and practice coding!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SOLUTION&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F96k31ijm17xlir8k83vm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F96k31ijm17xlir8k83vm.png" alt="Image description" width="800" height="432"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
    <item>
      <title>30 Days of Code HackerRank using JAVASCRIPT DAY 0</title>
      <dc:creator>Teja</dc:creator>
      <pubDate>Sun, 07 Jul 2024 19:49:40 +0000</pubDate>
      <link>https://dev.to/saiteja_amshala_035a7d7f1/30-days-of-code-hackerrank-using-javascriptday-0-469f</link>
      <guid>https://dev.to/saiteja_amshala_035a7d7f1/30-days-of-code-hackerrank-using-javascriptday-0-469f</guid>
      <description>&lt;p&gt;Objective&lt;br&gt;
In this challenge, we review some basic concepts that will get you started with this series. You will need to use the same (or similar) syntax to read input and write output in challenges throughout HackerRank. Check out the Tutorial tab for learning materials and an instructional video!&lt;/p&gt;

&lt;p&gt;Task&lt;br&gt;
To complete this challenge, you must save a line of input from stdin to a variable, print Hello, World. on a single line, and finally print the value of your variable on a second line.&lt;/p&gt;

&lt;p&gt;You've got this!&lt;/p&gt;

&lt;p&gt;Note: The instructions are Java-based, but we support submissions in many popular languages. You can switch languages using the drop-down menu above your editor, and the  variable may be written differently depending on the best-practice conventions of your submission language.&lt;/p&gt;

&lt;p&gt;Input Format&lt;/p&gt;

&lt;p&gt;A single line of text denoting  (the variable whose contents must be printed).&lt;/p&gt;

&lt;p&gt;Output Format&lt;/p&gt;

&lt;p&gt;Print Hello, World. on the first line, and the contents of  on the second line.&lt;/p&gt;

&lt;p&gt;Sample Input&lt;/p&gt;

&lt;p&gt;Welcome to 30 Days of Code!&lt;br&gt;
Sample Output&lt;/p&gt;

&lt;p&gt;Hello, World. &lt;br&gt;
Welcome to 30 Days of Code!&lt;br&gt;
Explanation&lt;/p&gt;

&lt;p&gt;On the first line, we print the string literal Hello, World.. On the second line, we print the contents of the  variable which, for this sample case, happens to be Welcome to 30 Days of Code!. If you do not print the variable's contents to stdout, you will not pass the hidden test case.&lt;/p&gt;

&lt;p&gt;SOLUTION: &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx0te9n6pqykqjwkwz52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmx0te9n6pqykqjwkwz52.png" alt="Image description" width="800" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>learning</category>
    </item>
  </channel>
</rss>
