<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3933313570623671267</id><updated>2026-01-12T18:27:48.599-08:00</updated><category term="UVA Onilne Judge Solution"/><category term="UVA-Volume1"/><category term="UVA-Volume 4"/><category term="UVA- Volume 2"/><category term="URI Online Judge Solution"/><category term="UVA-Volume 3"/><category term="Hackerrank Online Judge Solution"/><category term="URI Solution -Beginner"/><category term="Hackerrank - Java Solutions"/><category term="C Programming"/><category term="CodeMarshal Online Judge Solution"/><category term="C Programming Code Example"/><category term="CodeChef Online Judge Solution"/><category term="CodeChef-Beginner Solution"/><category term="Hackerrank-algorithms"/><category term="URI Solution - SQL"/><category term="UVA-Volume 5"/><category term="Codeforces Online Judge Solution"/><category term="SPOJ Online Judge Solution"/><category term="SPOJ-Classical Solution"/><category term="URI Solution - Graph"/><category term="URI Solution - Data Structure"/><category term="Programming"/><category term="Codeforces-Math"/><category term="Hackerrank - Bash Tutorials"/><category term="Guest Posts"/><category term="Hackerrank Artificial Intelligence"/><category term="Hackerrank-Mathematics"/><category term="LightOj - Beginner"/><category term="LightOj Online Judge Solution"/><category term="URI Solution - Ad Hoc"/><category term="UVA- Easy Problems"/><title type='text'>Online Judge Solution</title><subtitle type='html'>It is a free Online judges problems solution list. Here you can  find UVA online Judge Solution, URI Online Judge Solution, Code Marshal Online Judge Solution, Spoz Online Judge Problems Solution</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default?start-index=26&amp;max-results=25'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>352</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-7855388392267558821</id><published>2019-05-11T15:31:00.001-07:00</published><updated>2019-05-11T15:41:54.475-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="URI Solution - Data Structure"/><title type='text'>URI Online Judge Solution 1252 - Data Structure | 1252 - Sort sort and sort</title><content type='html'>&lt;h3 style=&quot;text-align: left;&quot;&gt;
URI Online Judge Solution Data Structure | 1252 - Sort sort and sort&lt;/h3&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
URI Online Judge Solution SQL | 1252 Sort sort and sort&amp;nbsp; | Beginner&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
URI Problem Link -&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://www.urionlinejudge.com.br/judge/en/problems/view/1252&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;URI Data Structure | 1252 Sort sort and sort Link&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Problem Name: Data Structure | Sort sort and sort&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Problem Number : URI - Data Structure | 1252 Sort sort and sort&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Online Judge : URI Online Judge Solution&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Category: Data Structure&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Solution Language : Data Structure&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: medium; font-weight: 400; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: medium; font-weight: 400; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;
URI Online Judge Solution 1252 - Data Structure | 1252 - Sort sort and sort: Using C++&lt;/h3&gt;
&lt;pre class=&quot;line-numbers&quot; style=&quot;font-weight: 400; text-align: left;&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;
#include&amp;lt;bits/stdc++.h&amp;gt;
using namespace std;
int m;
bool comp (int a, int b){
    if (b%m == a%m)
        if(abs(a)%2 ==abs(b)%2){
            if (a%2 != 0){
                return a &amp;gt; b;
            }else{ 
                return b &amp;gt; a;
            }
        }
        return abs(a)%2 &amp;gt; abs(b)%2; 
    }
    return a%m &amp;lt; b%m;
}
int main()
{
    int n;
 
    while(cin&amp;gt;&amp;gt;n&amp;gt;&amp;gt;m&amp;amp;&amp;amp;n&amp;amp;&amp;amp;m){
    int a[n];
    for(int i=0;i&amp;lt;n;i++)
    {
        cin&amp;gt;&amp;gt;a[i];
    }
    sort(a,a+n,comp);
    cout&amp;lt;&amp;lt;n&amp;lt;&amp;lt;&quot; &quot;&amp;lt;&amp;lt;m&amp;lt;&amp;lt;endl;
    for(int i=0;i&amp;lt;n;i++)
        cout&amp;lt;&amp;lt;a[i]&amp;lt;&amp;lt;endl;
    }
    printf(&quot;0 0n&quot;);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;center style=&quot;font-size: medium; font-weight: 400; text-align: center;&quot;&gt;
&lt;iframe allowtransparency=&quot;true&quot; data-aa=&quot;627149&quot; scrolling=&quot;no&quot; src=&quot;https://ad.a-ads.com/627149?size=300x250&quot; style=&quot;border-style: initial; border-width: 0px; height: 250px; overflow: hidden; padding: 0px; width: 300px;&quot;&gt;&lt;/iframe&gt;&lt;/center&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;h3&gt;
URI Online Judge Solution 1252 - Data Structure | 1252 - Sort sort and sort: Using C Language&lt;/h3&gt;
&lt;pre class=&quot;line-numbers&quot; style=&quot;-webkit-text-stroke-width: 0px; color: black; font-style: normal; font-variant-caps: normal; font-variant-ligatures: normal; font-weight: 400; letter-spacing: normal; margin: 0px; orphans: 2; text-align: left; text-decoration-color: initial; text-decoration-style: initial; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px;&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;
#include &amp;lt;stdio.h&amp;gt;
#include &amp;lt;stdlib.h&amp;gt;
#include &amp;lt;math.h&amp;gt;
#include &amp;lt;string.h&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;algorithm&amp;gt;

using namespace std;

int M;


bool comp (int a, int b){
    if (b%M == a%M){ /// retorna primeiro os impares e depois os pares;
        if(abs(a)%2 ==abs(b)%2){ ///comparando dois pares ou dois impares
            if (a%2 != 0){ ///impares
                return a &amp;gt; b;
            }else{ ///a e b s?o pares
                return b &amp;gt; a;
            }
        }
        return abs(a)%2 &amp;gt; abs(b)%2; /// impares antes dos pares
    }
    return a%M &amp;lt; b%M;
}

int main()
{
	int N, cont;

	scanf(&quot;%d&quot;, &amp;amp;N);
	scanf(&quot;%d&quot;, &amp;amp;M);

	while(N!=0 &amp;amp;&amp;amp; M!=0)
	{
		int vetor[N];
		printf(&quot;%d %d\n&quot;, N, M);

		for(cont=0;cont&amp;lt;N;cont++){
			scanf(&quot;%d&quot;, &amp;amp;vetor[cont]);
		}

		sort(vetor,vetor+N,comp);

		for(cont=0;cont&amp;lt;N;cont++){
			printf(&quot;%d\n&quot;, vetor[cont]);
		}

		scanf(&quot;%d&quot;, &amp;amp;N);
		scanf(&quot;%d&quot;, &amp;amp;M);

	}
	printf(&quot;0 0\n&quot;);

	return 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Demonstration:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver, URI all problem solution list, URI SQL |URI Online Judge Solution 1252 - Data Structure | 1252 - Sort sort and sort, URI 1252 URI Online Judge Solution 1252 - Data Structure | 1252 - Sort sort and sort&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/7855388392267558821/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2019/05/uri-online-judge-solution-1252-sort.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/7855388392267558821'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/7855388392267558821'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2019/05/uri-online-judge-solution-1252-sort.html' title='URI Online Judge Solution 1252 - Data Structure | 1252 - Sort sort and sort'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s72-c/DbzWSouY.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-3574227590509056960</id><published>2019-04-05T12:43:00.004-07:00</published><updated>2019-04-05T12:47:26.802-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="URI Solution - SQL"/><title type='text'>URI Online Judge Solution SQL | 2609 Products by Categories - Solution in PostgreSQL</title><content type='html'>&lt;h3 style=&quot;text-align: left;&quot;&gt;
URI Online Judge Solution SQL | 2609 Products by Categories - Solution in PostgreSQL&lt;/h3&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
URI Online Judge Solution SQL | 2609 Products by Categories&amp;nbsp; | Beginner&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
URI Problem Link -&amp;nbsp;&amp;nbsp;&lt;a href=&quot;https://www.urionlinejudge.com.br/judge/en/problems/view/2609&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;URI SQL | 2609 Products by Categories Link&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Problem Name: SQL | 2609 Products by Categories&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Problem Number : URI - SQL | 2609 Products by Categories&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Online Judge : URI Online Judge Solution&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Category: SQL&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Solution Language : SQL, postgreSQL. mySQL&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: medium; font-weight: 400; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; font-size: medium; font-weight: 400; text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;h3&gt;
URI Solution SQL | 2609 Products by Categories&amp;nbsp;Code in SQL, PostgreSQL, MySQL:&lt;/h3&gt;

&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;langugage-clike&quot;&gt;
select categories.name, sum(products.amount) 
from products, categories 
where products.id_categories = categories.id 
group by categories.name;
&lt;/code&gt;
&lt;/pre&gt;

&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;center style=&quot;font-size: medium; font-weight: 400; text-align: left;&quot;&gt;
&lt;iframe allowtransparency=&quot;true&quot; data-aa=&quot;627149&quot; scrolling=&quot;no&quot; src=&quot;https://ad.a-ads.com/627149?size=300x250&quot; style=&quot;border-style: initial; border-width: 0px; height: 250px; overflow: hidden; padding: 0px; width: 300px;&quot;&gt;&lt;/iframe&gt;&lt;/center&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: medium; font-weight: 400; text-align: start;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver, URI all problem solution list, URI SQL | 2608 Higher and Lower Price, URI 2609 Products by Categories SQL Solution,&amp;nbsp;URI Solution - SQL, URI Online Judge Solution, , URI Higher and Lower price solution, URI 2609 Products by Categories solution&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/3574227590509056960/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2019/04/uri-online-judge-solution-sql-2609.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/3574227590509056960'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/3574227590509056960'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2019/04/uri-online-judge-solution-sql-2609.html' title='URI Online Judge Solution SQL | 2609 Products by Categories - Solution in PostgreSQL'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s72-c/DbzWSouY.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-1278841547260732504</id><published>2018-06-24T11:41:00.000-07:00</published><updated>2019-03-13T07:18:42.053-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Guest Posts"/><title type='text'>‘Do My Assignment for Me’ Orders: All Kinds of Difficult Projects Done with Ease</title><content type='html'>&lt;h2 style=&quot;text-align: center;&quot;&gt;
‘Do My Assignment for Me’ Orders: All Kinds of Difficult Projects Done with Ease&lt;/h2&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; Students dealing with their programming degree program usually get stuck in the process, as accomplishing the assignments like research papers on JAVA, reports on Python or app development, or any programming issues is a challenging task for them. Most of the discipline homework projects are time-consuming and quite frustrating. Thus, it makes hard for the college and university students to get the assignments done within the set date and they search for a professional programming projects writing services. &lt;b&gt;You don’t need to make it a terrible educational experience, so be sure to approach one of the custom writing websites available online with a quick message like ‘Could you please &lt;a href=&quot;https://assigncode.com/&quot; target=&quot;_blank&quot;&gt;do my assignment&lt;/a&gt;?’ AssignCode.com is one of the sites, where professional programming solutions are provided&lt;/b&gt;. Perfection in every ‘Please, make my assignment shine!’ order is what the company guarantees for a fair price.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp;The company has a huge team of experts of the computer science ready to provide educational help and assignment writing guidance. The people working for AssignCode.com will address any high school, college or university problem which you may be facing performing a specific task. 
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
Make My Assignment: Different Programming Languages Covered! &lt;/h2&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; When your college project has something to do with the programming languages, you may find it too hard to work on one since there are more than 800 of them! But for the companies like AssignCode.com impossible is nothing. You place the ‘Make my assignment for me, please’ order and make sure all the requirements are being provided. The company assigns your project with the best writer, who has the relevant experience with the programming languages and is free at the moment. &lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; The various fields, or programming languages, in which the company renders programming assistance services are: Python, Ruby, C++, PHP, C#, JavaScript, SQL, etc. The team of IT specialists work hand-in-hand to provide you with the top quality answers for the most difficult projects on the languages mentioned above and many more.  Their knowledge, efforts and experience lead to a supreme quality assignments that is written professionally from both aspects – practical and theoretical.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h2 style=&quot;text-align: center;&quot;&gt;
AssignCode.com: Why Do You Need Help with Programming Tasks? &lt;/h2&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&amp;nbsp; &amp;nbsp; The company’s years of experience in communication with college students taking a programming course suggest that nearly every student has to handle certain problems while working on the various projects. Among the reasons that make professional help from someone at AssignCode.com necessary are the ones mentioned below: &lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;ul style=&quot;list-style-type: square;&quot;&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;Difficulty&lt;/u&gt;&lt;/b&gt;. As mentioned earlier, programming is one of the areas students need a dedicated helper in. Being a real expert at it requires dozens of time, determination and focus. In order to grasp the subject as good as possible, it should find a competent academic problem solver from the website like &lt;a href=&quot;http://assigncode.com/&quot;&gt;AssignCode.com&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;Demanding discipline&lt;/u&gt;&lt;/b&gt;. Taking into account the fact that the subject is quite vast and demanding, it’s no wonder college students search for the cheap writing services to approach with their ‘Do you have skilled writers, who can write my programming paper for me?’ message. Typically, students have more than 2-3 tasks to solve at a time, which is why working with &lt;a href=&quot;http://assigncode.com/&quot;&gt;AssignCode.com&lt;/a&gt; is always a good idea.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;Lack of time&lt;/u&gt;&lt;/b&gt;. One of the reasons why you approach custom writing companies to buy a project from lies in the fact that you don’t have enough time to memorize all the codes and programing languages. &lt;a href=&quot;http://assigncode.com/&quot;&gt;AssignCode.com&lt;/a&gt; company offers pocket-friendly options for money to help you deal with the time-consuming projects.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;u&gt;Supervision&lt;/u&gt;&lt;/b&gt;. Here’s one of the major reasons why you’ll be there next time you’re assigned with the programming assignment – the lack of supervision. If you don’t know how to cope with the MBA programming assignment, please, feel free to approach &lt;a href=&quot;http://assigncode.com/&quot;&gt;AssignCode.com&lt;/a&gt; for some guidance.&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;b id=&quot;docs-internal-guid-855e7a4f-3306-7718-0d8f-e5bfce75772b&quot; style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;line-height: 1.2; margin-bottom: 0pt; margin-top: 0pt; text-align: justify; text-indent: 7.1pt;&quot;&gt;
&lt;span style=&quot;background-color: transparent; color: black; font-family: &amp;quot;calibri&amp;quot;; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre;&quot;&gt;&lt;a href=&quot;https://assigncode.com/&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;C:\Users\Валентина\Desktop\Без імені.png&quot; src=&quot;https://lh5.googleusercontent.com/hkjV_cMimZta3ICzZcKqILkOLEIKGlZXWxTo4S7faqBjYPosaHFEdCaTdCbD3i_9_pDk6uRA391ZT0iht-VUtOJ0lRZFQarAfUz373k1km_Z5dGNwFcQPwEGqIb9xbEXVPfb4Kk2XMXlJ-E7JA&quot; style=&quot;border: none; transform: rotate(0rad);&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&amp;nbsp; &amp;nbsp; If you don’t compose the programming assignments properly and within the required deadline, look for professional help from a reliable source. &lt;a href=&quot;http://assigncode.com/&quot;&gt;AssignCode.com&lt;/a&gt; won’t let you slip on your grades, that’s for sure.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/1278841547260732504/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2018/06/do-my-assignment-for-me-orders-all.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/1278841547260732504'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/1278841547260732504'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2018/06/do-my-assignment-for-me-orders-all.html' title='‘Do My Assignment for Me’ Orders: All Kinds of Difficult Projects Done with Ease'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://lh5.googleusercontent.com/hkjV_cMimZta3ICzZcKqILkOLEIKGlZXWxTo4S7faqBjYPosaHFEdCaTdCbD3i_9_pDk6uRA391ZT0iht-VUtOJ0lRZFQarAfUz373k1km_Z5dGNwFcQPwEGqIb9xbEXVPfb4Kk2XMXlJ-E7JA=s72-c" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-4475490994146007468</id><published>2018-04-08T13:13:00.002-07:00</published><updated>2018-09-19T11:53:14.870-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="URI Online Judge Solution"/><category scheme="http://www.blogger.com/atom/ns#" term="URI Solution - SQL"/><title type='text'>URI Online Judge Solution SQL | 2608 Higher and Lower Price - Solution in PostgreSQL</title><content type='html'>&lt;h3 style=&quot;text-align: center;&quot;&gt;
URI Online Judge Solution SQL | 2608 Higher and Lower Price - Solution in PostgreSQL&lt;/h3&gt;
URI Online Judge Solution SQL | 2608 Higher and Lower Price&amp;nbsp; | Beginner&lt;br /&gt;
URI Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.urionlinejudge.com.br/judge/en/problems/view/2608&quot; target=&quot;_blank&quot;&gt;URI SQL | 2608 Higher and Lower Price Link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- G&amp;R_728x90 --&gt;
&lt;script id=&quot;GNR44313&quot;&gt;
    (function (i,g,b,d,c) {
        i[g]=i[g]||function(){(i[g].q=i[g].q||[]).push(arguments)};
        var s=d.createElement(b);s.async=true;s.src=c;
        var x=d.getElementsByTagName(b)[0];
        x.parentNode.insertBefore(s, x);
    })(window,&#39;gandrad&#39;,&#39;script&#39;,document,&#39;//content.green-red.com/lib/display.js&#39;);
    gandrad({siteid:14841,slot:44313});
&lt;/script&gt;
&lt;!-- End of G&amp;R_728x90 --&gt;
Problem Name: SQL | 2608 Higher and Lower Price&lt;br /&gt;
Problem Number : URI - SQL | 2608 Higher and Lower Price&lt;br /&gt;
Online Judge : URI Online Judge Solution&lt;br /&gt;
Category: SQL&lt;br /&gt;
Solution Language : SQL, postgreSQL. mySQL&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
URI Solution SQL | 2608 Higher and Lower Price&amp;nbsp;&amp;nbsp;Code in SQL, PostgreSQL, MySQL:&lt;/h3&gt;
&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;SELECT max(price) as price, min(price) as price
FROM products&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
&lt;iframe allowtransparency=&quot;true&quot; data-aa=&quot;627149&quot; scrolling=&quot;no&quot; src=&quot;//ad.a-ads.com/627149?size=300x250&quot; style=&quot;border: 0px; height: 250px; overflow: hidden; padding: 0; width: 300px;&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Demonstration:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
Just use the max() and min() function of mySQL. max(atribute_name) returns the max value of that column from the table.&lt;br /&gt;
&amp;nbsp;In this line-&lt;br /&gt;
&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;SELECT max(price) as price, min(price) as price&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver, URI all problem solution list, URI SQL | 2608 Higher and Lower Price, URI 2608 SQL Solution,&amp;nbsp;URI Solution - SQL, URI Online Judge Solution, , URI Higher and Lower price solution, URI 2608 solution</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/4475490994146007468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2018/04/uri-online-judge-solution-sql-2608.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/4475490994146007468'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/4475490994146007468'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2018/04/uri-online-judge-solution-sql-2608.html' title='URI Online Judge Solution SQL | 2608 Higher and Lower Price - Solution in PostgreSQL'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s72-c/DbzWSouY.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-83942423597911309</id><published>2018-04-08T12:37:00.001-07:00</published><updated>2018-09-19T11:54:28.903-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="URI Online Judge Solution"/><category scheme="http://www.blogger.com/atom/ns#" term="URI Solution - SQL"/><title type='text'>URI Online Judge Solution SQL | 2605 Executive Representatives - Solution in PostGreSQL</title><content type='html'>&lt;h3 style=&quot;text-align: center;&quot;&gt;
URI Online Judge Solution SQL | 2605 Executive Representatives - Solution in PostGreSQL&lt;/h3&gt;
URI Online Judge Solution 2605 Executive Representatives&amp;nbsp;&amp;nbsp; | SQL&lt;br /&gt;
URI Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.urionlinejudge.com.br/judge/en/problems/view/2605&quot; target=&quot;_blank&quot;&gt;URI 2605 Executive Representatives&amp;nbsp; Link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Problem Name: URI 2605 Executive Representatives&lt;br /&gt;
Problem Number : URI - 2605 Executive Representatives&lt;br /&gt;
Online Judge : URI Online Judge Solution&lt;br /&gt;
Category: SQL&lt;br /&gt;
Solution Language : SQL, PostgreSQL&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkBbFrioCFzC3D8yO6_fV2fkwWI84PSRUDoJQjD1P0L4KSNV8ctiwTd2-gVQDEXtFymnGGq9Bka7ZPSmpiJ0N83I3yla_xRlhQBQQmmqYpYje14TCsQD1WE7N-3odJoNFS0ovsg9v1k8iD/s1600/URI-2605.jpg&quot; imageanchor=&quot;1&quot;&gt;&lt;img alt=&quot;URI Online Judge Solution SQL | 2605 Executive Representatives - Solution in PostGreSQL&quot; border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkBbFrioCFzC3D8yO6_fV2fkwWI84PSRUDoJQjD1P0L4KSNV8ctiwTd2-gVQDEXtFymnGGq9Bka7ZPSmpiJ0N83I3yla_xRlhQBQQmmqYpYje14TCsQD1WE7N-3odJoNFS0ovsg9v1k8iD/s1600/URI-2605.jpg&quot; title=&quot;URI Online Judge Solution SQL | 2605 Executive Representatives - Solution in PostGreSQL&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
URI Solution 2605 Executive Representatives&amp;nbsp;&amp;nbsp;Code in PostgreSQL:&lt;/h3&gt;
&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;SELECT products.name, providers.name
FROM products, providers
WHERE products.id_categories = 6 and products.id_providers = providers.id;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; data-aa=&quot;627149&quot; scrolling=&quot;no&quot; src=&quot;//ad.a-ads.com/627149?size=300x250&quot; style=&quot;border: 0px; height: 250px; overflow: hidden; padding: 0; width: 300px;&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Demonstration:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;In this URI 2605 problem,&lt;br /&gt;
We&#39;ve to find the name of the products and name of the providers.&lt;br /&gt;
So first line,&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;SELECT products.name, providers.name&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;!-- G&amp;R_728x90 --&gt;
&lt;script id=&quot;GNR44313&quot;&gt;
    (function (i,g,b,d,c) {
        i[g]=i[g]||function(){(i[g].q=i[g].q||[]).push(arguments)};
        var s=d.createElement(b);s.async=true;s.src=c;
        var x=d.getElementsByTagName(b)[0];
        x.parentNode.insertBefore(s, x);
    })(window,&#39;gandrad&#39;,&#39;script&#39;,document,&#39;//content.green-red.com/lib/display.js&#39;);
    gandrad({siteid:14841,slot:44313});
&lt;/script&gt;
&lt;!-- End of G&amp;R_728x90 --&gt;
Then&amp;nbsp; From which table(products, providers) needs to calculate/joining&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;FROM products, providers&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
Finally the actual condition: The matching condition whose id_categories = 6 and the provider id also, So the SQL Query for that condition-&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;WHERE products.id_categories = 6 and products.id_providers = providers.id;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
[Having any problem since, just comment here and I&#39;ll try to help to solve all URI online judge problems at most.]&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver, URI all problem solution list, URI 2605 Executive Representatives Code in mysql, URI 2605 Executive Representatives solution in sql, URI 2605 solution, URI 2605 code example, URI Online judge 2605 Code solution, URI 2605 solution, URI Solution,</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/83942423597911309/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2018/04/uri-online-judge-solution-sql-2605.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/83942423597911309'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/83942423597911309'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2018/04/uri-online-judge-solution-sql-2605.html' title='URI Online Judge Solution SQL | 2605 Executive Representatives - Solution in PostGreSQL'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkBbFrioCFzC3D8yO6_fV2fkwWI84PSRUDoJQjD1P0L4KSNV8ctiwTd2-gVQDEXtFymnGGq9Bka7ZPSmpiJ0N83I3yla_xRlhQBQQmmqYpYje14TCsQD1WE7N-3odJoNFS0ovsg9v1k8iD/s72-c/URI-2605.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-6892566174113948894</id><published>2018-04-08T09:28:00.002-07:00</published><updated>2018-04-08T12:40:49.167-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="URI Online Judge Solution"/><category scheme="http://www.blogger.com/atom/ns#" term="URI Solution - SQL"/><title type='text'>URI Online Judge Solution SQL | 2606 Categories - PostGreSQL Solution - Code</title><content type='html'>&lt;h3 style=&quot;text-align: center;&quot;&gt;
URI Online Judge Solution SQL | 2606 Categories - PostGreSQL Solution - Code&lt;/h3&gt;
URI Online Judge Solution SQL | 2606 Categories | SQL&lt;br /&gt;
URI Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.urionlinejudge.com.br/judge/en/problems/view/2606&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Problem Name: SQL | 2606 Categories&lt;br /&gt;
Problem Number : URI - SQL | 2606 Categories&lt;br /&gt;
Online Judge : URI Online Judge Solution&lt;br /&gt;
Category: SQL&lt;br /&gt;
Solution Language : PostGreSQL&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
URI Solution SQL | 2606 Categories&amp;nbsp;Code in PostGreSQL:&lt;/h3&gt;
&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;SELECT products.id, products.name
FROM products
JOIN categories
ON products.id_categories = categories.id
WHERE categories.name like &#39;super%&#39;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; data-aa=&quot;627149&quot; scrolling=&quot;no&quot; src=&quot;//ad.a-ads.com/627149?size=300x250&quot; style=&quot;border: 0px; height: 250px; overflow: hidden; padding: 0; width: 300px;&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Demonstration:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
This is query with join the two table using SQL, WHERE query, and finally like query.&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;JOIN for joining two table&lt;/li&gt;
&lt;li&gt;WHERE for giving condition&lt;/li&gt;
&lt;li&gt;LIKE for searching.&lt;/li&gt;
&lt;/ol&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Links for learning to solve this problem:&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;https://www.w3schools.com/sql/sql_join.asp&quot; target=&quot;_blank&quot;&gt;Learn SQL Join in W3School&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.w3schools.com/sql/sql_where.asp&quot; target=&quot;_blank&quot;&gt;Learn SQL WHERE in W3School&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.w3schools.com/sql/sql_like.asp&quot; target=&quot;_blank&quot;&gt;Learn SQL Like Query in W3School&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver, URI all problem solution list,&amp;nbsp;URI Online Judge Solution SQL | 2606 Categories - PostGreSQL Solution - Code, URI 2606 solution, URI&amp;nbsp;2606 Categories,&amp;nbsp;2606 Categories Solution URI online judge, URI&amp;nbsp;2606 Categories code,&amp;nbsp;2606 Categories in PostgreSQL URI online judge</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/6892566174113948894/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2018/04/uri-online-judge-solution-sql-2606.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/6892566174113948894'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/6892566174113948894'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2018/04/uri-online-judge-solution-sql-2606.html' title='URI Online Judge Solution SQL | 2606 Categories - PostGreSQL Solution - Code'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s72-c/DbzWSouY.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-6809378435004529650</id><published>2018-04-07T13:02:00.003-07:00</published><updated>2018-04-07T13:02:57.065-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="URI Online Judge Solution"/><category scheme="http://www.blogger.com/atom/ns#" term="URI Solution - SQL"/><title type='text'>URI Online Judge Solution SQL | 2607 Providers&#39; City in Alphabetical Order - PostgreSQL Solution</title><content type='html'>&lt;h3 style=&quot;text-align: center;&quot;&gt;
URI Online Judge | &amp;nbsp;SQL | 2607 Providers&#39; City in Alphabetical Order - Solution in PostgreSQL&lt;/h3&gt;
URI Online Judge Solution 2607 Providers&#39; City in Alphabetical Order&amp;nbsp;&amp;nbsp; | SQL&lt;br /&gt;
URI Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.urionlinejudge.com.br/judge/en/problems/view/2607&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Problem Name: 2607 Providers&#39; City in Alphabetical Order&lt;br /&gt;
Problem Number : URI - 2607 Providers&#39; City in Alphabetical Order&lt;br /&gt;
Online Judge : URI Online Judge Solution&lt;br /&gt;
Category: SQL&lt;br /&gt;
Solution Language : PostGreSQL&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
URI Solution 2607 Providers&#39; City in Alphabetical Order&amp;nbsp;&amp;nbsp;Code in PostgreSQL:&lt;/h3&gt;
&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;SELECT DISTINCT city FROM providers ORDER BY city ASC&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
&lt;iframe allowtransparency=&quot;true&quot; data-aa=&quot;627149&quot; scrolling=&quot;no&quot; src=&quot;//ad.a-ads.com/627149?size=300x250&quot; style=&quot;border: 0px; height: 250px; overflow: hidden; padding: 0; width: 300px;&quot;&gt;&lt;/iframe&gt;
&lt;/center&gt;
&lt;br /&gt;
&lt;h3&gt;
URI Solution&amp;nbsp; Code / URI solution in PostGreSQL:&lt;/h3&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;SELECT DISTINCT city FROM providers ORDER BY city ASC&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;h3&gt;
URI Solution&amp;nbsp; Code / URI solution in SQL:&lt;/h3&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;SELECT DISTINCT city FROM providers ORDER BY city ASC&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h3&gt;
URI Solution Code / URI solution in&amp;nbsp;&amp;nbsp;Python:&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
URI Solution Code / URI&amp;nbsp; solution in&amp;nbsp;&amp;nbsp;C# (C Sharp):&lt;/h3&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Demonstration:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
Just implement this in coding. Since having any problem just put a comment below. Thanks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver, URI all problem solution list, URI 2607 Providers&#39; City in Alphabetical Order&amp;nbsp; code in C, URI 2607 Providers&#39; City in Alphabetical Order&amp;nbsp;Weighted Averages&amp;nbsp;code in C++, URI Area of a circle solution in C, URI&amp;nbsp;solution, URI 2607Weighted Averages&amp;nbsp;solution in C,URI 2607 Providers&#39; Cvity in Alphabetical Order&amp;nbsp;Weighted Averages&amp;nbsp;solution in C++-CPP,URI https://www.urionlinejudge.com.br/judge/en/problems/view/2607 Weighted Averages&amp;nbsp;solution in C# (C sharp),URI 2607 Providers&#39; City in Alphabetical Order&amp;nbsp;Weighted Averages&amp;nbsp;solution in Java,URI 1079 Weighted Averages&amp;nbsp;solution in Python,</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/6809378435004529650/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2018/04/uri-online-judge-solution-sql-2607.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/6809378435004529650'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/6809378435004529650'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2018/04/uri-online-judge-solution-sql-2607.html' title='URI Online Judge Solution SQL | 2607 Providers&#39; City in Alphabetical Order - PostgreSQL Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s72-c/DbzWSouY.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-1488474772215160809</id><published>2017-12-21T11:30:00.000-08:00</published><updated>2018-09-19T11:54:49.299-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="URI Online Judge Solution"/><category scheme="http://www.blogger.com/atom/ns#" term="URI Solution - Ad Hoc"/><title type='text'>URI Online Judge Solution 1030 Flavious Josephus Legend - Solution in C, C++, Java, Python and C#</title><content type='html'>&lt;h3 style=&quot;text-align: center;&quot;&gt;
URI Online Judge Solution 1030 Flavious Josephus Legend - Solution in C, C++, Java, Python and C#&lt;/h3&gt;
URI Online Judge Solution 1030 Flavious Josephus Legend&amp;nbsp;&amp;nbsp; | Beginner&lt;br /&gt;
URI Problem Link -&amp;nbsp; link&lt;br /&gt;
&lt;br /&gt;
Problem Name: 1030 Flavious Josephus Legend&lt;br /&gt;
Problem Number : URI - 1030 Flavious Josephus Legend&lt;br /&gt;
Online Judge : URI Online Judge Solution&lt;br /&gt;
&lt;!-- G&amp;R_728x90 --&gt;
&lt;script id=&quot;GNR44313&quot;&gt;
    (function (i,g,b,d,c) {
        i[g]=i[g]||function(){(i[g].q=i[g].q||[]).push(arguments)};
        var s=d.createElement(b);s.async=true;s.src=c;
        var x=d.getElementsByTagName(b)[0];
        x.parentNode.insertBefore(s, x);
    })(window,&#39;gandrad&#39;,&#39;script&#39;,document,&#39;//content.green-red.com/lib/display.js&#39;);
    gandrad({siteid:14841,slot:44313});
&lt;/script&gt;
&lt;!-- End of G&amp;R_728x90 --&gt;
Category: Beginner&lt;br /&gt;
Solution Language : C,C plus plus, java, python, c#(c sharp)&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
URI Solution 1030 Flavious Josephus Legend&amp;nbsp;&amp;nbsp;Code in C:&lt;/h3&gt;
&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;#include &amp;lt;stdio.h&amp;gt;
int josephusLoop(int n, int k, int startingPoint)
{
 if(n == 1)
  return 1;

 int newSp, survivor;
 newSp = (startingPoint + k - 2) % n + 1;
  survivor = josephusLoop(n - 1, k, newSp);

  if(survivor &amp;lt; newSp){
   return survivor;
  }else{
   return survivor + 1;
  }
}

int josephus(int n, int k)
{
 return josephusLoop(n, k, 1);
}

int main()
{
 int nc, n, k, s, i;
 scanf(&quot;%i&quot;, &amp;amp;nc);

 for (i = 1; i &amp;lt;= nc; ++i)
 {
  scanf(&quot;%i %i&quot;, &amp;amp;n, &amp;amp;k);
  s = josephus(n, k);
  printf(&quot;Case %i: %i\n&quot;, i, s);
 }

 return 0;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; data-aa=&quot;627149&quot; scrolling=&quot;no&quot; src=&quot;//ad.a-ads.com/627149?size=300x250&quot; style=&quot;border: 0px; height: 250px; overflow: hidden; padding: 0; width: 300px;&quot;&gt;&lt;/iframe&gt;

&lt;br /&gt;
&lt;h3&gt;
URI Solution&amp;nbsp;1030 Flavious Josephus Legend&amp;nbsp; Code / URI 1030 solution in CPP:&lt;/h3&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;#include &amp;lt;cstdio&amp;gt;
using namespace std;

int josephusLoop(int n, int k, int startingPoint)
{
 if(n == 1)
  return 1;

 int newSp, survivor;
 newSp = (startingPoint + k - 2) % n + 1;
  survivor = josephusLoop(n - 1, k, newSp);
  
  if(survivor &amp;lt; newSp){
   return survivor;
  }else{
   return survivor + 1;
  }
}

int josephus(int n, int k)
{
 return josephusLoop(n, k, 1);
}

int main()
{
 int nc, n, k, s;
 scanf(&quot;%i&quot;, &amp;amp;nc);

 for (int i = 1; i &amp;lt;= nc; ++i)
 {
  scanf(&quot;%i %i&quot;, &amp;amp;n, &amp;amp;k);
  s = josephus(n, k);
  printf(&quot;Case %i: %i\n&quot;, i, s);
 }

 return 0;
}&lt;/code&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;h3&gt;
URI Solution&amp;nbsp;1030 Flavious Josephus Legend&amp;nbsp; Code / URI 1030 solution in Java:&lt;/h3&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    static FastScanner in = new FastScanner(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {

        int NC = in.nextInt(), n, k;
        for (int i = 1; i &amp;lt;= NC; i++) {
            n = in.nextInt();
            k = in.nextInt();
            out.println(&quot;Case &quot; + i + &quot;: &quot; + (josephus(n, k) + 1));
        }
        in.close();
        out.close();
    }

    private static int josephus(int n, int k) {
        // Runtime error :/
        /* if (n == 1) {
            return 0;
        }
        return (josephus(n - 1, m) + m) % n; */
        int ans = 0;
        for (int i = 2; i &amp;lt;= n; i++) {
            ans = (ans + k) % i;
        }

        return ans;
    }

    static class FastScanner implements Closeable {

        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        public FastScanner(InputStream input) {
            reader = new BufferedReader(
                    new InputStreamReader(input));
            tokenizer = new StringTokenizer(&quot;&quot;);
        }

        public String next() throws IOException {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                String line = reader.readLine();
                if (line == null) {
                    return null;
                }
                tokenizer = new StringTokenizer(line);
            }
            return tokenizer.nextToken();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public float nextFloat() throws IOException {
            return Float.parseFloat(next());
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        @Override
        public void close() throws IOException {
            tokenizer = null;
            reader.close();
        }
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;h3&gt;
URI Solution 1030 Flavious Josephus Legend&amp;nbsp;Code / URI solution in&amp;nbsp;&amp;nbsp;Python:&lt;/h3&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;h3&gt;
URI Solution Code / URI&amp;nbsp; solution in&amp;nbsp;&amp;nbsp;C# (C Sharp):&lt;/h3&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Demonstration:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
Just implement this in coding. Since having any problem just put a comment below. Thanks&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver, URI all problem solution list,URI Online Judge Solution, URI Solution - Ad Hoc,&amp;nbsp; URI&amp;nbsp;1030 Flavious Josephus Legend,&amp;nbsp;URI Online Judge Solution 1030 Flavious Josephus Legend - Solution in C, C++, Java, Python and C#</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/1488474772215160809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/uri-online-judge-solution-1030-flavious.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/1488474772215160809'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/1488474772215160809'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/uri-online-judge-solution-1030-flavious.html' title='URI Online Judge Solution 1030 Flavious Josephus Legend - Solution in C, C++, Java, Python and C#'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s72-c/DbzWSouY.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-1985812422440638559</id><published>2017-12-21T11:05:00.000-08:00</published><updated>2017-12-21T11:05:15.077-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="URI Online Judge Solution"/><category scheme="http://www.blogger.com/atom/ns#" term="URI Solution - SQL"/><title type='text'>URI Online Judge SQL Solution 2604 Under 10 or Greater Than 100 - Solution in PostgreSQL</title><content type='html'>&lt;h3 style=&quot;text-align: center;&quot;&gt;
URI Online Judge SQL Solution 2604 Under 10 or Greater Than 100 - Solution in PostgreSQL&lt;/h3&gt;
URI Online Judge Solution 2604 Under 10 or Greater Than 100&amp;nbsp;&amp;nbsp; | SQL&lt;br /&gt;
URI Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.urionlinejudge.com.br/judge/en/problems/view/2604&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Problem Name: 2604 Under 10 or Greater Than 100&lt;br /&gt;
Problem Number : URI 2604 Under 10 or Greater Than 100&lt;br /&gt;
Online Judge : URI Online Judge Solution&lt;br /&gt;
Category: SQL&lt;br /&gt;
Solution Language : PostgreSQL&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
URI Solution 2604 Under 10 or Greater Than 100&amp;nbsp;&amp;nbsp;&amp;nbsp;Code in PostgreSQL:&lt;/h3&gt;
&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;SELECT products.id, products.name FROM products WHERE products.price &amp;lt; 10 or products.price &amp;gt; 100;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; data-aa=&quot;627149&quot; scrolling=&quot;no&quot; src=&quot;//ad.a-ads.com/627149?size=300x250&quot; style=&quot;border: 0px; height: 250px; overflow: hidden; padding: 0; width: 300px;&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Demonstration:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
Basic Select query with a where clause SQL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver,&amp;nbsp;URI Online Judge SQL Solution URI Online Judge SQL Solution2604 Under 10 or Greater Than 100&amp;nbsp; - Solution in PostgreSQL -&amp;nbsp; Solution in PostgreSQL, URI SQL Solution, URI SQL Solution, URI 2604 solution, URI PostgreSQL Code solution</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/1985812422440638559/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/uri-online-judge-sql-solution-2604.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/1985812422440638559'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/1985812422440638559'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/uri-online-judge-sql-solution-2604.html' title='URI Online Judge SQL Solution 2604 Under 10 or Greater Than 100 - Solution in PostgreSQL'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s72-c/DbzWSouY.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-2372445259273094951</id><published>2017-12-21T10:58:00.001-08:00</published><updated>2019-05-09T15:12:13.829-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="URI Online Judge Solution"/><category scheme="http://www.blogger.com/atom/ns#" term="URI Solution - SQL"/><title type='text'>URI Online Judge SQL Solution 2603 Customer Address - Solution in PostgreSQL</title><content type='html'>&lt;h3 style=&quot;text-align: center;&quot;&gt;
URI Online Judge SQL Solution 2603 Customer Address - Solution in PostgreSQL&lt;/h3&gt;
URI Online Judge Solution 2603 Customer Address&amp;nbsp; | SQL&lt;br /&gt;
URI Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.urionlinejudge.com.br/judge/en/problems/view/2602&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt;&lt;br /&gt;

&lt;!-- ADconity.com - Ad Display Code --&gt;
&lt;center&gt;&lt;script data-cfasync=&quot;false&quot; type=&quot;text/javascript&quot; src=&quot;//adconity.com/display/items.php?4991&amp;10837&amp;300&amp;275&amp;4&amp;0&amp;0&quot;&gt;&lt;/script&gt;&lt;/center&gt;
&lt;!-- ADconity.com - Ad Display Code --&gt;

&lt;br /&gt;
Problem Name:2603 Customer Address&lt;br /&gt;
Problem Number : URI 2603 Customer Address&lt;br /&gt;
Online Judge : URI Online Judge Solution&lt;br /&gt;
Category: SQL&lt;br /&gt;
Solution Language : PostgreSQL&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
URI Solution 2603 Customer Address&amp;nbsp;&amp;nbsp;Code in PostgreSQL:&lt;/h3&gt;
&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;SELECT customers.name, customers.street FROM customers WHERE customers.city = &#39;Porto Alegre&#39;;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; data-aa=&quot;627149&quot; scrolling=&quot;no&quot; src=&quot;//ad.a-ads.com/627149?size=300x250&quot; style=&quot;border: 0px; height: 250px; overflow: hidden; padding: 0; width: 300px;&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Demonstration:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
Basic Select query with a where clause SQL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver,&amp;nbsp;URI Online Judge SQL Solution URI Online Judge SQL Solution 2603 Customer Address - Solution in PostgreSQL -&amp;nbsp; Solution in PostgreSQL, URI SQL Solution, URI SQL Solution, URI 2603 solution, URI PostgreSQL Code solution</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/2372445259273094951/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/uri-online-judge-sql-solution-2603.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/2372445259273094951'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/2372445259273094951'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/uri-online-judge-sql-solution-2603.html' title='URI Online Judge SQL Solution 2603 Customer Address - Solution in PostgreSQL'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s72-c/DbzWSouY.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-7108699209805403910</id><published>2017-12-21T10:52:00.001-08:00</published><updated>2018-09-19T11:56:13.750-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="URI Online Judge Solution"/><category scheme="http://www.blogger.com/atom/ns#" term="URI Solution - SQL"/><title type='text'>URI Online Judge SQL Solution 2602 Basic Select -  Solution in PostgreSQL</title><content type='html'>&lt;h3 style=&quot;text-align: center;&quot;&gt;
URI Online Judge SQL Solution 2602 Basic Select -&amp;nbsp; Solution in PostgreSQL&lt;/h3&gt;
URI Online Judge Solution 2602 Basic Select&amp;nbsp;&amp;nbsp; | SQL&lt;br /&gt;
URI Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.urionlinejudge.com.br/judge/en/problems/view/2602&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;!-- G&amp;R_728x90 --&gt;
&lt;script id=&quot;GNR44313&quot;&gt;
    (function (i,g,b,d,c) {
        i[g]=i[g]||function(){(i[g].q=i[g].q||[]).push(arguments)};
        var s=d.createElement(b);s.async=true;s.src=c;
        var x=d.getElementsByTagName(b)[0];
        x.parentNode.insertBefore(s, x);
    })(window,&#39;gandrad&#39;,&#39;script&#39;,document,&#39;//content.green-red.com/lib/display.js&#39;);
    gandrad({siteid:14841,slot:44313});
&lt;/script&gt;
&lt;!-- End of G&amp;R_728x90 --&gt;
&lt;br /&gt;
Problem Name: 2602 Basic Select&lt;br /&gt;
Problem Number : URI 2602 Basic Select&lt;br /&gt;
Online Judge : URI Online Judge Solution&lt;br /&gt;
Category: SQL&lt;br /&gt;
Solution Language : PostgreSQL&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s1600/DbzWSouY.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;
URI Solution 2602 Basic Select&amp;nbsp;&amp;nbsp;Code in PostgreSQL:&lt;/h3&gt;
&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-clike&quot;&gt;SELECT customers.name FROM customers WHERE customers.state = &#39;RS&#39;;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;iframe allowtransparency=&quot;true&quot; data-aa=&quot;627149&quot; scrolling=&quot;no&quot; src=&quot;//ad.a-ads.com/627149?size=300x250&quot; style=&quot;border: 0px; height: 250px; overflow: hidden; padding: 0; width: 300px;&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Demonstration:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
Basic Select query with a where clause SQL&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;URI Online Judge Solution, URI OJ Solution list, URI Problems Solution, URI solver,&amp;nbsp;URI Online Judge SQL Solution 2602 Basic Select -&amp;nbsp; Solution in PostgreSQL, URI SQL Solution, URI SQL Solution</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/7108699209805403910/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/uri-online-judge-sql-solution-2602.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/7108699209805403910'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/7108699209805403910'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/uri-online-judge-sql-solution-2602.html' title='URI Online Judge SQL Solution 2602 Basic Select -  Solution in PostgreSQL'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho-lDnqo96DSNzDj_nELGiuZmDO8WKZPzXrK2r5TE4_-CwkUuSrLP9-mXUOioA_n6OLitXxppCer4vaOtBDsVv2kQ-CnWHrd46TFMfkYWiKSBLnjg6OHBkTPH9sSAj7PNcJlxV5LuWwOxv/s72-c/DbzWSouY.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-8053510045895548864</id><published>2017-12-12T20:28:00.000-08:00</published><updated>2017-12-12T20:30:40.136-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Artificial Intelligence"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>HackerRank BattleShip Code Solution</title><content type='html'>&lt;h3&gt;
HackerRank BattleShip Code Solution&lt;/h3&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmvOip7G96svBKzj_Wr8MJKb2yEyf0hd0_zktLKHuvbmGO5ywEqgUrCvxPTi_DsL-4SN46jMQnbdFpS5zCEjMtnVP2gM2Tl2HJw5H7U3s_RTfu2_6Bhcc_uBO3-9js1ZhHlBddSXpo3Jwh/s1600/HackerRank1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;HackerRank BattleShip Code Solution&quot; border=&quot;0&quot; data-original-height=&quot;648&quot; data-original-width=&quot;612&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmvOip7G96svBKzj_Wr8MJKb2yEyf0hd0_zktLKHuvbmGO5ywEqgUrCvxPTi_DsL-4SN46jMQnbdFpS5zCEjMtnVP2gM2Tl2HJw5H7U3s_RTfu2_6Bhcc_uBO3-9js1ZhHlBddSXpo3Jwh/s200/HackerRank1.png&quot; title=&quot;HackerRank BattleShip Code Solution&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;BattleShip&lt;br /&gt;
Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.hackerrank.com/challenges/battleship&quot; target=&quot;_blank&quot;&gt;BattleShip &lt;/a&gt;&lt;br /&gt;
Level - Artificial Intelligence&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;import java.io.BufferedWriter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileWriter;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Random;
import java.util.Scanner;

public class Battleship {
 public static void main(String[] args) {
  Scanner scn = new Scanner(System.in);
  String out = scn.nextLine();

  if (out.equals(&quot;INIT&quot;)) {
   System.out.println(&quot;3 0&quot;);
   System.out.println(&quot;9 9&quot;);
   System.out.println(&quot;6 4:6 5&quot;);
   System.out.println(&quot;3 7:4 7&quot;);
   System.out.println(&quot;7 7:7 9&quot;);
   System.out.println(&quot;1 5:1 8&quot;);
   System.out.println(&quot;3 2:7 2&quot;);
  } else {
   String[] board = new String[10];
   @SuppressWarnings(&quot;unused&quot;)
   boolean printed = false;

   for (int i = 0; i &amp;lt; 10; i++) {
    board[i] = scn.nextLine();
   }

   File fileName = new File(&quot;myfile.txt&quot;);

   if (!fileName.exists()) {
    try {
     fileName.createNewFile();
     FileWriter fileWrite = new FileWriter(fileName);
     BufferedWriter bufferedWriter = new BufferedWriter(
       fileWrite);
     ArrayList&amp;lt;Integer&amp;gt; moves = getRandom(board);
     int x = moves.get(0);
     int y = moves.get(1);
     bufferedWriter.write(x + &quot; &quot; + y);
     bufferedWriter.close();
     System.out.println(x + &quot; &quot; + y);
    } catch (IOException e) {
    }
   } else {
    try {
     byte[] buffer = new byte[100];
     FileInputStream inputStream = new FileInputStream(fileName);
     @SuppressWarnings(&quot;unused&quot;)
     int readLines = -1;
     String last_move = &quot;&quot;;

     while ((readLines = inputStream.read(buffer)) != -1) {
      last_move = new String(buffer);
     }

     inputStream.close();
     int x = Character.getNumericValue(last_move.charAt(0));
     int y = Character.getNumericValue(last_move.charAt(2));

     if (board[x].charAt(y) == &#39;h&#39;) {
      if (x + 1 &amp;lt; 10 &amp;amp;&amp;amp; board[x + 1].charAt(y) == &#39;h&#39;) {
       for (int i = 1; i &amp;lt; 9 - x; i++) {
        if (x - i &amp;gt;= 0 &amp;amp;&amp;amp; board[x - i].charAt(y) == &#39;-&#39;) {
         x -= i;
         break;
        } else if (x - i &amp;gt;= 0
          &amp;amp;&amp;amp; board[x - i].charAt(y) == &#39;m&#39;) {
         break;
        }
       }

       for (int i = 1; i &amp;lt; 9 - x; i++) {
        if (x + i &amp;lt; 10 &amp;amp;&amp;amp; board[x + i].charAt(y) == &#39;-&#39;) {
         x += i;
         break;
        } else if (x + i &amp;lt; 10
          &amp;amp;&amp;amp; board[x + i].charAt(y) == &#39;m&#39;) {
         break;
        }
       }
      } else if (x - 1 &amp;gt;= 0 &amp;amp;&amp;amp; board[x - 1].charAt(y) == &#39;h&#39;) {
       for (int i = 1; i &amp;lt; 9 - x; i++) {
        if (x - i &amp;gt;= 0 &amp;amp;&amp;amp; board[x - i].charAt(y) == &#39;-&#39;) {
         x -= i;
         break;
        } else if (x - i &amp;gt;= 0
          &amp;amp;&amp;amp; board[x - i].charAt(y) == &#39;m&#39;) {
         break;
        }
       }

       for (int i = 1; i &amp;lt; 9 - x; i++) {
        if (x + i &amp;lt; 10 &amp;amp;&amp;amp; board[x + i].charAt(y) == &#39;-&#39;) {
         x += i;
         break;
        } else if (x + i &amp;lt; 10
          &amp;amp;&amp;amp; board[x + i].charAt(y) == &#39;m&#39;) {
         break;
        }
       }
      } else if (y + 1 &amp;lt; 10 &amp;amp;&amp;amp; board[x].charAt(y + 1) == &#39;h&#39;) {
       for (int i = 1; i &amp;lt; 9 - y; i++) {
        if (y - i &amp;gt;= 0 &amp;amp;&amp;amp; board[x].charAt(y - i) == &#39;-&#39;) {
         y -= i;
         break;
        } else if (y - i &amp;gt;= 0
          &amp;amp;&amp;amp; board[x].charAt(y - i) == &#39;m&#39;) {
         break;
        }
       }

       for (int i = 1; i &amp;lt; 9 - y; i++) {
        if (y + i &amp;lt; 10 &amp;amp;&amp;amp; board[x].charAt(y + i) == &#39;-&#39;) {
         y += i;
         break;
        } else if (y + i &amp;lt; 10
          &amp;amp;&amp;amp; board[x].charAt(y + i) == &#39;m&#39;) {
         break;
        }
       }
      } else if (y - 1 &amp;gt;= 0 &amp;amp;&amp;amp; board[x].charAt(y - 1) == &#39;h&#39;) {
       for (int i = 1; i &amp;lt; 9 - y; i++) {
        if (y - i &amp;gt;= 0 &amp;amp;&amp;amp; board[x].charAt(y - i) == &#39;-&#39;) {
         y -= i;
         break;
        } else if (y - i &amp;gt;= 0
          &amp;amp;&amp;amp; board[x].charAt(y - i) == &#39;m&#39;) {
         break;
        }
       }

       for (int i = 1; i &amp;lt; 9 - y; i++) {
        if (y + i &amp;lt; 10 &amp;amp;&amp;amp; board[x].charAt(y + i) == &#39;-&#39;) {
         y += i;
         break;
        } else if (y + i &amp;lt; 10
          &amp;amp;&amp;amp; board[x].charAt(y + i) == &#39;m&#39;) {
         break;
        }
       }
      } else {
       ArrayList&amp;lt;Integer&amp;gt; moves = getRemainingHit(board);
       x = moves.get(0);
       y = moves.get(1);
      }
     } else {
      ArrayList&amp;lt;Integer&amp;gt; moves = getRemainingHit(board);
      x = moves.get(0);
      y = moves.get(1);
     }

     while (board[x].charAt(y) != &#39;-&#39;) {
      ArrayList&amp;lt;Integer&amp;gt; moves = getRandom(board);
      x = moves.get(0);
      y = moves.get(1);
     }

     fileName.createNewFile();
     FileWriter fileWrite = new FileWriter(fileName);
     BufferedWriter bufferedWriter = new BufferedWriter(
       fileWrite);
     bufferedWriter.write(x + &quot; &quot; + y);
     bufferedWriter.close();
     System.out.println(x + &quot; &quot; + y);
    } catch (IOException e) {
    }
   }
  }
 }

 private static ArrayList&amp;lt;Integer&amp;gt; getRemainingHit(String[] board) {
  ArrayList&amp;lt;Integer&amp;gt; to_return = new ArrayList&amp;lt;Integer&amp;gt;();
  boolean added = false;

  for (int x = 0; x &amp;lt; 10; x++) {
   for (int y = 0; y &amp;lt; 10; y++) {
    if (board[x].charAt(y) == &#39;h&#39;) {
     if (x - 1 &amp;gt;= 0 &amp;amp;&amp;amp; board[x - 1].charAt(y) == &#39;-&#39;) {
      to_return.add(x - 1);
      to_return.add(y);
      added = true;
     } else if (x + 1 &amp;lt; 10 &amp;amp;&amp;amp; board[x + 1].charAt(y) == &#39;-&#39;) {
      to_return.add(x + 1);
      to_return.add(y);
      added = true;
     } else if (y - 1 &amp;gt;= 0 &amp;amp;&amp;amp; board[x].charAt(y - 1) == &#39;-&#39;) {
      to_return.add(x);
      to_return.add(y - 1);
      added = true;
     } else if (y + 1 &amp;lt; 10 &amp;amp;&amp;amp; board[x].charAt(y + 1) == &#39;-&#39;) {
      to_return.add(x);
      to_return.add(y + 1);
      added = true;
     }
    }

    if (added) {
     return to_return;
    }
   }
  }

  return getRandom(board);
 }

 private static ArrayList&amp;lt;Integer&amp;gt; getRandom(String[] board) {
  ArrayList&amp;lt;Integer&amp;gt; to_return = new ArrayList&amp;lt;Integer&amp;gt;();
  Random ran = new Random();
  int x = 0;
  int y = 0;

  do {
   x = ran.nextInt(10);
   y = ran.nextInt(10);
  } while (board[x].charAt(y) != &#39;-&#39;);

  to_return.add(x);
  to_return.add(y);

  return to_return;
 }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Output:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Hackerrank Online Judge Solution, Hackerrank Artificial Intelligence</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/8053510045895548864/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-battleship-code-solution.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/8053510045895548864'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/8053510045895548864'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-battleship-code-solution.html' title='HackerRank BattleShip Code Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmvOip7G96svBKzj_Wr8MJKb2yEyf0hd0_zktLKHuvbmGO5ywEqgUrCvxPTi_DsL-4SN46jMQnbdFpS5zCEjMtnVP2gM2Tl2HJw5H7U3s_RTfu2_6Bhcc_uBO3-9js1ZhHlBddSXpo3Jwh/s72-c/HackerRank1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-6657076212892512367</id><published>2017-12-12T20:14:00.003-08:00</published><updated>2017-12-12T20:14:24.635-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Tag Content Extractor Solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Tag Content Extractor Solution&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s1600/HackerRank1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;HackerRank Problem Solution&quot; border=&quot;0&quot; data-original-height=&quot;648&quot; data-original-width=&quot;612&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s200/HackerRank1.png&quot; title=&quot;HackerRank Problem Solution&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;&amp;nbsp;Tag Content Extractor&lt;br /&gt;
Problem Link -&amp;nbsp; &amp;nbsp;&lt;a href=&quot;https://www.hackerrank.com/challenges/tag-content-extractor/problem&quot; target=&quot;_blank&quot;&gt;Tag Content Extractor &lt;/a&gt;&lt;br /&gt;
Level - String&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Solution {
    public static void main(String[] args) {
        Scanner scan  = new Scanner(System.in);
        int testCases = Integer.parseInt(scan.nextLine());
        
        /* Solution assumes we can&#39;t have the symbol &quot;&amp;lt;&quot; as text between tags */
        while (testCases-- &amp;gt; 0) {
            String line = scan.nextLine();
            boolean matchFound = false;
            Pattern r = Pattern.compile(&quot;&amp;lt;(.+)&amp;gt;([^&amp;lt;]+)&amp;lt;/\\1&amp;gt;&quot;);
            Matcher m = r.matcher(line);
            while (m.find()) {
                System.out.println(m.group(2));
                matchFound = true;
            }
            if (!matchFound) {
                System.out.println(&quot;None&quot;);
            }
        }
        scan.close();
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Hackerrank - Java Solution - Tag Content Extractor Solution,&amp;nbsp;Hackerrank Online Judge Solution, Hackerrank - Java Solutions,</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/6657076212892512367/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-tag-content.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/6657076212892512367'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/6657076212892512367'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-tag-content.html' title='Hackerrank - Java Solution - Tag Content Extractor Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s72-c/HackerRank1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-709715037142122778</id><published>2017-12-12T20:10:00.002-08:00</published><updated>2017-12-12T20:10:45.107-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Valid Username Regular Expression Solution Hackerrank - Java Solution</title><content type='html'>&lt;h3&gt;
Valid Username Regular Expression Solution Hackerrank - Java Solution&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s1600/HackerRank1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;HackerRank Problem Solution&quot; border=&quot;0&quot; data-original-height=&quot;648&quot; data-original-width=&quot;612&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s200/HackerRank1.png&quot; title=&quot;HackerRank Problem Solution&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;Valid Username Regular Expression&lt;br /&gt;
Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.hackerrank.com/challenges/valid-username-checker/problem&quot; target=&quot;_blank&quot;&gt;Valid Username Regular Expression &lt;/a&gt;&lt;br /&gt;
Level - String&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Only Submitted Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;class UsernameValidator {
    public static final String regularExpression = &quot;([a-zA-Z])(\\w){7,29}&quot;;
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Full Source Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;import java.util.Scanner;

class UsernameValidator {
    public static final String regularExpression = &quot;([a-zA-Z])(\\w){7,29}&quot;;
}
public class Solution {
    private static final Scanner scan = new Scanner(System.in);
    
    public static void main(String[] args) {
        int n = Integer.parseInt(scan.nextLine());
        while (n-- != 0) {
            String userName = scan.nextLine();

            if (userName.matches(UsernameValidator.regularExpression)) {
                System.out.println(&quot;Valid&quot;);
            } else {
                System.out.println(&quot;Invalid&quot;);
            }           
        }
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Welcome to Java!,&amp;nbsp;Valid Username Regular Expression Solution Hackerrank - Java Solution</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/709715037142122778/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/valid-username-regular-expression.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/709715037142122778'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/709715037142122778'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/valid-username-regular-expression.html' title='Valid Username Regular Expression Solution Hackerrank - Java Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s72-c/HackerRank1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-194925844258455189</id><published>2017-12-12T20:01:00.002-08:00</published><updated>2017-12-12T20:02:25.602-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Java Regex 2 - Duplicate Words Solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Java Regex 2 - Duplicate Words Solution&lt;/h3&gt;
Problem Name -&amp;nbsp;Java Regex 2 - Duplicate Words&lt;br /&gt;
Problem Link -&amp;nbsp; &lt;span style=&quot;color: #0000ee;&quot;&gt;&lt;u&gt;&lt;a href=&quot;https://www.hackerrank.com/challenges/duplicate-word/problem&quot; target=&quot;_blank&quot;&gt;Java Regex 2 - Duplicate Words&amp;nbsp;&lt;/a&gt;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
Level - String&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class DuplicateWords {

    public static void main(String[] args) {

        String regex = &quot;\\b(\\w+)(\\W+\\1\\b)+&quot;;
        Pattern p = Pattern.compile(regex, Pattern.CASE_INSENSITIVE);

        Scanner in = new Scanner(System.in);
        int numSentences = Integer.parseInt(in.nextLine());
        
        while (numSentences-- &amp;gt; 0) {
            String input = in.nextLine();
            
            Matcher m = p.matcher(input);
            
            // Check for subsequences of input that match the compiled pattern
            while (m.find()) {
                input = input.replaceAll(m.group(), m.group(1));
            }
            
            // Prints the modified sentence.
            System.out.println(input);
        }
        
        in.close();
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Output:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF1oe48po3XcIAb3MbLkdhAlmJb0Iqv4sv-TsBXRAURFAz4Lyhh6RhKaDBGuw7AyV1zE2FvDuu8Ck3thN7fny2B1UpbYHsr9Ll3q7ngdo-UMCzTc9IkSng2cgBhVgr6UERRggU6Dr1BXZn/s1600/Java+-+Regexp+2+-+Duplicate+Word+Solution.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Hackerrank - Java Solution - Java Regex 2 - Duplicate Words Solution&quot; border=&quot;0&quot; data-original-height=&quot;509&quot; data-original-width=&quot;426&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF1oe48po3XcIAb3MbLkdhAlmJb0Iqv4sv-TsBXRAURFAz4Lyhh6RhKaDBGuw7AyV1zE2FvDuu8Ck3thN7fny2B1UpbYHsr9Ll3q7ngdo-UMCzTc9IkSng2cgBhVgr6UERRggU6Dr1BXZn/s1600/Java+-+Regexp+2+-+Duplicate+Word+Solution.jpg&quot; title=&quot;Hackerrank - Java Solution - Java Regex 2 - Duplicate Words Solution&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Hackerrank Online Judge Solution, Hackerrank - Java Solutions,&amp;nbsp;Hackerrank - Java Solution - Java Regex 2 - Duplicate Words Solution</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/194925844258455189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-regex-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/194925844258455189'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/194925844258455189'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-regex-2.html' title='Hackerrank - Java Solution - Java Regex 2 - Duplicate Words Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgF1oe48po3XcIAb3MbLkdhAlmJb0Iqv4sv-TsBXRAURFAz4Lyhh6RhKaDBGuw7AyV1zE2FvDuu8Ck3thN7fny2B1UpbYHsr9Ll3q7ngdo-UMCzTc9IkSng2cgBhVgr6UERRggU6Dr1BXZn/s72-c/Java+-+Regexp+2+-+Duplicate+Word+Solution.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-2060787421488182245</id><published>2017-12-12T19:56:00.000-08:00</published><updated>2017-12-12T19:56:14.745-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Java Regex Solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Java Regex Solution&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s1600/HackerRank1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;HackerRank Problem Solution&quot; border=&quot;0&quot; data-original-height=&quot;648&quot; data-original-width=&quot;612&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s200/HackerRank1.png&quot; title=&quot;HackerRank Problem Solution&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;Java Regex&lt;br /&gt;
Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.hackerrank.com/challenges/java-regex/problem&quot; target=&quot;_blank&quot;&gt;Java Regex&amp;nbsp; &lt;/a&gt;&lt;br /&gt;
Level - String&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Only Submitted Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;/*
     [01]?\\d{1,2}   matches numbers 0-199.
     2[0-4]\\d       matches numbers 200-249
     25[0-5]         matches numbers 250-255
*/
class MyRegex {
    String num = &quot;([01]?\\d{1,2}|2[0-4]\\d|25[0-5])&quot;;
    String pattern = num + &quot;.&quot; +  num + &quot;.&quot; +  num + &quot;.&quot; + num;
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Full Source Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.Scanner;

class Solution{

    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            String IP = in.next();
            System.out.println(IP.matches(new MyRegex().pattern));
        }

    }
}
/*
     [01]?\\d{1,2}   matches numbers 0-199.
     2[0-4]\\d       matches numbers 200-249
     25[0-5]         matches numbers 250-255
*/
class MyRegex {
    String num = &quot;([01]?\\d{1,2}|2[0-4]\\d|25[0-5])&quot;;
    String pattern = num + &quot;.&quot; +  num + &quot;.&quot; +  num + &quot;.&quot; + num;
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Hackerrank - Java Solution - Java Regex Solution,&amp;nbsp;Hackerrank Online Judge Solution, Hackerrank - Java Solutions,</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/2060787421488182245/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-regex.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/2060787421488182245'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/2060787421488182245'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-regex.html' title='Hackerrank - Java Solution - Java Regex Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s72-c/HackerRank1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-3944593518536034396</id><published>2017-12-12T19:51:00.003-08:00</published><updated>2017-12-12T19:51:34.547-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Pattern Syntax Checker Solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Pattern Syntax Checker Solution&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s1600/HackerRank1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;HackerRank Problem Solution&quot; border=&quot;0&quot; data-original-height=&quot;648&quot; data-original-width=&quot;612&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s200/HackerRank1.png&quot; title=&quot;HackerRank Problem Solution&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;&amp;nbsp;Pattern Syntax Checker&lt;br /&gt;
Problem Link -&amp;nbsp; &amp;nbsp;&lt;a href=&quot;https://www.hackerrank.com/challenges/pattern-syntax-checker/problem&quot; target=&quot;_blank&quot;&gt;Pattern Syntax Checker&amp;nbsp; &lt;/a&gt;&lt;br /&gt;
Level - String&lt;br /&gt;
Point - 20&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;import java.util.Scanner;
import java.util.regex.Pattern;
import java.util.regex.PatternSyntaxException;

public class Solution {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int testCases = scan.nextInt();
        scan.nextLine();
        
        // If a PatternSyntaxException is not thrown by Pattern.compile, the regular expresion is valid
        while (testCases-- &amp;gt; 0) {
           String pattern = scan.nextLine();
           try {
               Pattern.compile(pattern);
               System.out.println(&quot;Valid&quot;);
           } catch (PatternSyntaxException exception) {
               System.out.println(&quot;Invalid&quot;);
           }
        }
        scan.close();
    }
}
&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Hackerrank - Java Solution - Pattern Syntax Checker Solution ,Hackerrank Online Judge Solution, Hackerrank - Java Solutions,</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/3944593518536034396/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-pattern-syntax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/3944593518536034396'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/3944593518536034396'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-pattern-syntax.html' title='Hackerrank - Java Solution - Pattern Syntax Checker Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s72-c/HackerRank1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-2377046346154312673</id><published>2017-12-12T19:48:00.000-08:00</published><updated>2017-12-12T19:48:00.779-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Java String Tokens solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Java String Tokens&lt;/h3&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;Java String Tokens&lt;br /&gt;
Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.hackerrank.com/challenges/java-string-tokens/problem&quot; target=&quot;_blank&quot;&gt;Java String Tokens &lt;/a&gt;&lt;br /&gt;
Level - String&lt;br /&gt;
Point - 15&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        /* Read input */
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        scan.close();
        
        s = s.trim(); // so that .split() works properly
        
        /* Check special cases */
        if (s.length() == 0) {
            System.out.println(0);
            return;
        }
        
        /* Split on all non-alphabetic characters */
        String [] words = s.split(&quot;[^a-zA-Z]+&quot;);
        
        /* Print output */
        System.out.println(words.length);
        for (String word : words) {
            System.out.println(word);
        }
    }
}
&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Output:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimYJuZS2Tx8fJoeOWbLaWCzsONcvmXGGAkIIiOH_bfj5Ho4wBDA6S3oGzFqj17jUAL7kQwLkwbBYuD_WvucQ2h8IEqwu53Uv7wkdxveQUf10WDZJMb2f-2O9AwcogxzKyaz6t8OHybPNE-/s1600/Java+-+Java+String+Tokens+Solution+Output.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Hackerrank - Java Solution - Java String Tokens solution&quot; border=&quot;0&quot; data-original-height=&quot;627&quot; data-original-width=&quot;972&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimYJuZS2Tx8fJoeOWbLaWCzsONcvmXGGAkIIiOH_bfj5Ho4wBDA6S3oGzFqj17jUAL7kQwLkwbBYuD_WvucQ2h8IEqwu53Uv7wkdxveQUf10WDZJMb2f-2O9AwcogxzKyaz6t8OHybPNE-/s1600/Java+-+Java+String+Tokens+Solution+Output.jpg&quot; title=&quot;Hackerrank - Java Solution - Java String Tokens solution&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Hackerrank - Java Solution - Java String Tokens,&amp;nbsp;Hackerrank Online Judge Solution, Hackerrank - Java Solutions,</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/2377046346154312673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-string_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/2377046346154312673'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/2377046346154312673'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-string_12.html' title='Hackerrank - Java Solution - Java String Tokens solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimYJuZS2Tx8fJoeOWbLaWCzsONcvmXGGAkIIiOH_bfj5Ho4wBDA6S3oGzFqj17jUAL7kQwLkwbBYuD_WvucQ2h8IEqwu53Uv7wkdxveQUf10WDZJMb2f-2O9AwcogxzKyaz6t8OHybPNE-/s72-c/Java+-+Java+String+Tokens+Solution+Output.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-5763272454922535646</id><published>2017-12-12T19:42:00.001-08:00</published><updated>2017-12-12T19:42:15.665-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Java Anagrams Solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Java Anagrams Solution&lt;/h3&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;Java Anagrams&lt;br /&gt;
Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.hackerrank.com/challenges/java-anagrams/problem&quot; target=&quot;_blank&quot;&gt;Java Anagrams&amp;nbsp; &lt;/a&gt;&lt;br /&gt;
Level - String&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Anagram Full Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;mport java.io.*;
import java.util.*;

public class Solution {
    static boolean isAnagram(String a, String b) {
        if ((a == null || b == null) || (a.length() != b.length())) {
            return false;
        }
        final char[] ARRAY_A = a.toUpperCase().toCharArray();
        final Map&lt;character integer=&quot;&quot;&gt; map = new HashMap&amp;lt;&amp;gt;();
        for (int i = 0; i &amp;lt; ARRAY_A.length; i ++) {
            if (map.containsKey(ARRAY_A[i])) {
                map.put(ARRAY_A[i], (map.get(ARRAY_A[i]) + 1));
            } else {
                map.put(ARRAY_A[i], 1);
            }
        }
        final char[] ARRAY_B = b.toUpperCase().toCharArray();
        for (int i = 0; i &amp;lt; ARRAY_A.length; i ++) {
            if (map.containsKey(ARRAY_B[i])) {
                Integer count = map.get(ARRAY_B[i]);
                if (count == 0) {
                    return false;
                } else {
                    count --;
                    map.put(ARRAY_B[i], count);
                }
            } else {
                return false;
            }
        }
        return true;
    }
    public static void main(String[] args) {
    
        Scanner scan = new Scanner(System.in);
        String a = scan.next();
        String b = scan.next();
        scan.close();
        boolean ret = isAnagram(a, b);
        System.out.println( (ret) ? &quot;Anagrams&quot; : &quot;Not Anagrams&quot; );
    }
}
&lt;/character&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Anagram Only Submitted Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;static boolean isAnagram(String a, String b) {
        if ((a == null || b == null) || (a.length() != b.length())) {
            return false;
        }
        final char[] ARRAY_A = a.toUpperCase().toCharArray();
        final Map&lt;character integer=&quot;&quot;&gt; map = new HashMap&amp;lt;&amp;gt;();
        for (int i = 0; i &amp;lt; ARRAY_A.length; i ++) {
            if (map.containsKey(ARRAY_A[i])) {
                map.put(ARRAY_A[i], (map.get(ARRAY_A[i]) + 1));
            } else {
                map.put(ARRAY_A[i], 1);
            }
        }
        final char[] ARRAY_B = b.toUpperCase().toCharArray();
        for (int i = 0; i &amp;lt; ARRAY_A.length; i ++) {
            if (map.containsKey(ARRAY_B[i])) {
                Integer count = map.get(ARRAY_B[i]);
                if (count == 0) {
                    return false;
                } else {
                    count --;
                    map.put(ARRAY_B[i], count);
                }
            } else {
                return false;
            }
        }
        return true;
    }
&lt;/character&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Output:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPrjbHu-_CH1owTCZ8jaB1fV_fyiWVvi7eWrKMzhLCGetmTKKes0Izj9BYNzLHqDWvLHsdcvsFTDvIWcqc5wT0pLhIUKebUWPMSEQGyuGP9VWi-03Dqk35xy5AS3s4Ov31kcQlCxxL0yX2/s1600/Java+-+Java+Anagram+Solution+Output.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Hackerrank - Java Solution - Java Anagrams Solution&quot; border=&quot;0&quot; data-original-height=&quot;387&quot; data-original-width=&quot;447&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPrjbHu-_CH1owTCZ8jaB1fV_fyiWVvi7eWrKMzhLCGetmTKKes0Izj9BYNzLHqDWvLHsdcvsFTDvIWcqc5wT0pLhIUKebUWPMSEQGyuGP9VWi-03Dqk35xy5AS3s4Ov31kcQlCxxL0yX2/s1600/Java+-+Java+Anagram+Solution+Output.jpg&quot; title=&quot;Hackerrank - Java Solution - Java Anagrams Solution&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Hackerrank - Java Solution - Java Anagrams Solution,&amp;nbsp;Hackerrank Online Judge Solution, Hackerrank - Java Solutions,</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/5763272454922535646/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-anagrams.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/5763272454922535646'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/5763272454922535646'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-anagrams.html' title='Hackerrank - Java Solution - Java Anagrams Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPrjbHu-_CH1owTCZ8jaB1fV_fyiWVvi7eWrKMzhLCGetmTKKes0Izj9BYNzLHqDWvLHsdcvsFTDvIWcqc5wT0pLhIUKebUWPMSEQGyuGP9VWi-03Dqk35xy5AS3s4Ov31kcQlCxxL0yX2/s72-c/Java+-+Java+Anagram+Solution+Output.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-1883767087377107219</id><published>2017-12-12T19:31:00.001-08:00</published><updated>2017-12-12T19:31:25.489-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Java String Reverse Solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Java String Reverse Solution&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s1600/HackerRank1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;HackerRank Problem Solution&quot; border=&quot;0&quot; data-original-height=&quot;648&quot; data-original-width=&quot;612&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s200/HackerRank1.png&quot; title=&quot;HackerRank Problem Solution&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;Java String Reverse&lt;br /&gt;
Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.hackerrank.com/challenges/java-string-reverse/problem&quot; target=&quot;_blank&quot;&gt;Java String Reverse&amp;nbsp;&lt;/a&gt;&lt;br /&gt;
Level - String&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        /* Read input */
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        scan.close();
        
        /* Reverse string and compare to original */
        /* If a String is equivalent to itself when reversed, it&#39;s a palindrome */
        
        String reversed = new StringBuilder(str).reverse().toString();
        System.out.println(str.equals(reversed) ? &quot;Yes&quot; : &quot;No&quot;);
    }
}
&lt;/pre&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Hackerrank Online Judge Solution, Hackerrank - Java Solutions,&amp;nbsp;Hackerrank - Java Solution - Java String Reverse Solution</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/1883767087377107219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-string.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/1883767087377107219'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/1883767087377107219'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-string.html' title='Hackerrank - Java Solution - Java String Reverse Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s72-c/HackerRank1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-1668764958907968109</id><published>2017-12-12T19:27:00.004-08:00</published><updated>2017-12-12T21:38:41.461-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Java Substring Comparisons Solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Java Substring Comparisons Solution&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s1600/HackerRank1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;HackerRank Problem Solution&quot; border=&quot;0&quot; data-original-height=&quot;648&quot; data-original-width=&quot;612&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s200/HackerRank1.png&quot; title=&quot;HackerRank Problem Solution&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;Java Substring Comparisons&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;iframe allowtransparency=&quot;true&quot; data-aa=&quot;627149&quot; scrolling=&quot;no&quot; src=&quot;//ad.a-ads.com/627149?size=300x250&quot; style=&quot;border: 0px; height: 250px; overflow: hidden; padding: 0; width: 300px;&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;br /&gt;
Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.hackerrank.com/challenges/java-string-compare/problem&quot; target=&quot;_blank&quot;&gt;https://www.hackerrank.com/challenges/java-string-compare/problem &lt;/a&gt;&lt;br /&gt;
Level - String&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        /* Save input */
        Scanner scan = new Scanner(System.in);
        String s = scan.nextLine();
        int k    = scan.nextInt();
        scan.close();
        
        /* Create smallest and largest strings and initialize them */
        String smallest = s.substring(0, k);
        String largest  = s.substring(0, k);

        for (int i = 0; i &amp;lt;= s.length() - k; i++) {
            String curr = s.substring(i, i + k);
            if (smallest.compareTo(curr) &amp;gt; 0){
                smallest = curr;
            }
            if (largest.compareTo(curr) &amp;lt; 0) {
                largest = curr;
            }
        }
        
        /* Print results */
        System.out.println(smallest);
        System.out.println(largest);
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,Hackerrank - Java Solution - Java Substring Comparisons Solution,&amp;nbsp;Hackerrank Online Judge Solution, Hackerrank - Java Solutions,</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/1668764958907968109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-substring_12.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/1668764958907968109'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/1668764958907968109'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-substring_12.html' title='Hackerrank - Java Solution - Java Substring Comparisons Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s72-c/HackerRank1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-7740970786841660095</id><published>2017-12-12T19:24:00.000-08:00</published><updated>2017-12-12T19:24:03.766-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Java Substring Solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Java Substring Solution&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s1600/HackerRank1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;HackerRank Problem Solution&quot; border=&quot;0&quot; data-original-height=&quot;648&quot; data-original-width=&quot;612&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s200/HackerRank1.png&quot; title=&quot;HackerRank Problem Solution&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;&amp;nbsp;Java Substring&lt;br /&gt;
Problem Link -&amp;nbsp; &amp;nbsp;&lt;a href=&quot;https://www.hackerrank.com/challenges/java-substring/problem&quot; target=&quot;_blank&quot;&gt;Java Substring &lt;/a&gt;&lt;br /&gt;
Level - String&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.next();
        int start  = scan.nextInt();
        int end    = scan.nextInt();
        scan.close();
        
        System.out.println(str.substring(start, end));
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;WHackerrank - Java Solution - Java Substring Solution,&amp;nbsp;Hackerrank Online Judge Solution, Hackerrank - Java Solutions,</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/7740970786841660095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-substring.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/7740970786841660095'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/7740970786841660095'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-substring.html' title='Hackerrank - Java Solution - Java Substring Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s72-c/HackerRank1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-8456452844153589880</id><published>2017-12-12T19:20:00.001-08:00</published><updated>2017-12-12T19:20:16.712-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Java Strings Introduction Solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Java Strings Introduction Solution&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s1600/HackerRank1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;HackerRank Problem Solution&quot; border=&quot;0&quot; data-original-height=&quot;648&quot; data-original-width=&quot;612&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s200/HackerRank1.png&quot; title=&quot;HackerRank Problem Solution&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;Java Strings Introduction&lt;br /&gt;
Problem Link -&amp;nbsp;&lt;a href=&quot;https://www.hackerrank.com/challenges/java-strings-introduction/problem&quot; target=&quot;_blank&quot;&gt; Java Strings Introduction&lt;/a&gt;&amp;nbsp; &lt;br /&gt;
Level - String&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;import java.util.Scanner;

public class Solution {
    public static void main(String[] args) {
        /* Save input */
        Scanner scan = new Scanner(System.in);
        String A = scan.next();
        String B = scan.next();
        scan.close();
        
        /* Sum lengths */
        System.out.println(A.length() + B.length());

        /* Compare lexicographical ordering */
        System.out.println(A.compareTo(B) &amp;gt; 0 ? &quot;Yes&quot; : &quot;No&quot;);
        
        /* Print the Strings in desired format */
        System.out.println(capFirstLetter(A) + &quot; &quot; + capFirstLetter(B));
    }
    
    private static String capFirstLetter(String str) {
        if (str == null || str.length() == 0) {
            return &quot;&quot;;
        } else {
            return str.substring(0,1).toUpperCase() + str.substring(1);
        }
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Hackerrank - Java Solution - Java Strings Introduction Solution,&amp;nbsp;Hackerrank Online Judge Solution, Hackerrank - Java Solutions,</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/8456452844153589880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-strings.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/8456452844153589880'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/8456452844153589880'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-strings.html' title='Hackerrank - Java Solution - Java Strings Introduction Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s72-c/HackerRank1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-5716808187446261969</id><published>2017-12-12T19:07:00.000-08:00</published><updated>2017-12-12T19:07:04.791-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Java Currency Formatter Solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Java Currency Formatter Solution&lt;/h3&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;Java Currency Formatter&lt;br /&gt;
Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.hackerrank.com/challenges/java-currency-formatter/problem&quot; target=&quot;_blank&quot;&gt;Java Currency Formatter&amp;nbsp; &lt;/a&gt;&lt;br /&gt;
Level - Introduction Challenges&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Code&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;import java.util.Scanner;
import java.text.NumberFormat;
import java.util.Locale;

public class Solution {
    public static void main(String[] args) {
        /* Save input */
        Scanner scan = new Scanner(System.in);
        double payment = scan.nextDouble();
        scan.close();

        /* Create custom Locale for India - I used the &quot;IANA Language Subtag Registry&quot; to find India&#39;s country code */
        Locale indiaLocale = new Locale(&quot;en&quot;, &quot;IN&quot;);

        /* Create NumberFormats using Locales */
        NumberFormat us     = NumberFormat.getCurrencyInstance(Locale.US);
        NumberFormat india  = NumberFormat.getCurrencyInstance(indiaLocale);
        NumberFormat china  = NumberFormat.getCurrencyInstance(Locale.CHINA);
        NumberFormat france = NumberFormat.getCurrencyInstance(Locale.FRANCE);

        /* Print output */        
        System.out.println(&quot;US: &quot;     + us.format(payment));
        System.out.println(&quot;India: &quot;  + india.format(payment));
        System.out.println(&quot;China: &quot;  + china.format(payment));
        System.out.println(&quot;France: &quot; + france.format(payment));
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Output:&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYdoVkO2igKw3P0Gptnrz7exHtvBOBp_a5TCas_jX1u95aU6Qixa4HIwaYdiZbHgBtQNXFS3xEDYy5DxNmgAs0FrIyeAGGEcbx3AWi-49F1UgczvjfBYdoTEppGvznZZwwu_Ikgn-xMbEz/s1600/Java+-+Java+Currency+Formatter+Soluiont.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Hackerrank - Java Solution - Java Currency Formatter Solution&quot; border=&quot;0&quot; data-original-height=&quot;421&quot; data-original-width=&quot;459&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYdoVkO2igKw3P0Gptnrz7exHtvBOBp_a5TCas_jX1u95aU6Qixa4HIwaYdiZbHgBtQNXFS3xEDYy5DxNmgAs0FrIyeAGGEcbx3AWi-49F1UgczvjfBYdoTEppGvznZZwwu_Ikgn-xMbEz/s1600/Java+-+Java+Currency+Formatter+Soluiont.jpg&quot; title=&quot;Hackerrank - Java Solution - Java Currency Formatter Solution&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Hackerrank - Java Solution - Java Currency Formatter Solution</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/5716808187446261969/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-currency.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/5716808187446261969'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/5716808187446261969'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-currency.html' title='Hackerrank - Java Solution - Java Currency Formatter Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgYdoVkO2igKw3P0Gptnrz7exHtvBOBp_a5TCas_jX1u95aU6Qixa4HIwaYdiZbHgBtQNXFS3xEDYy5DxNmgAs0FrIyeAGGEcbx3AWi-49F1UgczvjfBYdoTEppGvznZZwwu_Ikgn-xMbEz/s72-c/Java+-+Java+Currency+Formatter+Soluiont.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3933313570623671267.post-7367421601398398759</id><published>2017-12-12T18:39:00.002-08:00</published><updated>2017-12-12T18:39:26.956-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank - Java Solutions"/><category scheme="http://www.blogger.com/atom/ns#" term="Hackerrank Online Judge Solution"/><title type='text'>Hackerrank - Java Solution - Java Int to String Solution</title><content type='html'>&lt;h3&gt;
Hackerrank - Java Solution - Java Int to String Solution&lt;/h3&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s1600/HackerRank1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;HackerRank Problem Solution&quot; border=&quot;0&quot; data-original-height=&quot;648&quot; data-original-width=&quot;612&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s200/HackerRank1.png&quot; title=&quot;HackerRank Problem Solution&quot; width=&quot;188&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
Problem Name -&amp;nbsp;Java Int to String&lt;br /&gt;
Problem Link -&amp;nbsp; &lt;a href=&quot;https://www.hackerrank.com/challenges/java-int-to-string&quot; target=&quot;_blank&quot;&gt;Java Int to String&lt;/a&gt;&lt;br /&gt;
Level - Introduction Challenges&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Only Submit Part Code&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;String s = &quot;&quot; + n;&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;span style=&quot;color: blue;&quot;&gt;Java Full Source Code&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;pre class=&quot;line-numbers&quot;&gt;&lt;code class=&quot;language-java&quot;&gt;import java.util.*;
import java.security.*;

public class Solution {
    public static void main(String[] args) {
        DoNotTerminate.forbidExit();
        try {
            Scanner in = new Scanner(System.in);
            int n = in .nextInt();
            in.close();
             
            /* Here are 3 ways to convert an int to a String */
            // String s = String.valueOf(n);
            // String s = Integer.toString(n);
            String s = &quot;&quot; + n;

            if (n == Integer.parseInt(s)) {
              System.out.println(&quot;Good job&quot;);
            } else {
              System.out.println(&quot;Wrong answer.&quot;);
            }
        } catch (DoNotTerminate.ExitTrappedException e) {
              System.out.println(&quot;Unsuccessful Termination!!&quot;);
        }
    }
}

// The following class will prevent you from terminating the code using exit(0)!
class DoNotTerminate {
    public static class ExitTrappedException extends SecurityException {
        private static final long serialVersionUID = 1;
    }
    public static void forbidExit() {
        final SecurityManager securityManager = new SecurityManager() {
            @Override
            public void checkPermission(Permission permission) {
            if (permission.getName().contains(&quot;exitVM&quot;)) {
                throw new ExitTrappedException();
            }
        }
    };
    System.setSecurityManager(securityManager);
    }
}&lt;/code&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;Tags: &lt;/span&gt;&lt;/b&gt;
HackerRank Online Judge Solution, HackerRank OJ Solution list, HackerRank Problems Solution, HackerRank solver, HackerRank all problem solution list, HackerRank solution in java, Hackerrank Java Solution,&amp;nbsp;Hackerrank - Java Solution - Java Int to String Solution,&amp;nbsp;Hackerrank Online Judge Solution, Hackerrank - Java Solutions,</content><link rel='replies' type='application/atom+xml' href='https://onlinejudgesolution.blogspot.com/feeds/7367421601398398759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-int-to.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/7367421601398398759'/><link rel='self' type='application/atom+xml' href='https://www.blogger.com/feeds/3933313570623671267/posts/default/7367421601398398759'/><link rel='alternate' type='text/html' href='https://onlinejudgesolution.blogspot.com/2017/12/hackerrank-java-solution-java-int-to.html' title='Hackerrank - Java Solution - Java Int to String Solution'/><author><name>Maniruzzaman Akash</name><uri>http://www.blogger.com/profile/04157809478260544020</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTEPI3E-HBRxXwNnLWjShX8GHjtoA0rlgxPhrfo7X9RbGUlbYSenm9sMIu928_z4qB7n6xd1TsDg8Ah0GgCTlTeCS201xgYPIOaMIPW9vd9vnRKgCWxp8Z3d7YQLG9f6F4Biu8z0yKs1ea/s72-c/HackerRank1.png" height="72" width="72"/><thr:total>1</thr:total></entry></feed>