โ
โ
โ
#HackerRank Highly Profitable Months - HackerRank C++ Solutions
int countHighlyProfitableMonths(vector<int> stockPrices,int k){
int n=stockPrices.size(),count=1;
vector<int> a;
for(int i=0;i+1<n;i++){
if(stockPrices[i+1]>stockPrices[i])
count+=1;
else{
a.push_back(count);
count=1;
}
}
a.push_back(count);
int ans=0;
for(auto x:a){
if(x>=k)
ans+=(x-k+1);
}
return ans;
}
โ
โ
โ
#HackerRank Last and Second-Last - Python HackerRank Solutions
def lastLetters(word):
return word[-1]+" "+word[-2]
word="APPLE"
print(lastLetters(word))
โ
โ
โ
#HackerRank Product of the Maximum and Minimum in a Dataset - Java HackerRank Solution
public static List<Long> maxMin(List<String> operations, List<Integer> x) {
List<Long> productArray = new ArrayList<Long>();
List<Long> a=new ArrayList<Long>();
int opsize=operations.size();
for(int y=0;y<opsize;y++)
{
if(operations.get(y).equals("push"))
{
a.add((long)x.get(y));
Collections.sort(a);
productArray.add(a.get(0)*a.get(a.size()-1));
}
else
{
a.remove((long)x.get(y));
Collections.sort(a);
productArray.add(a.get(0)*a.get(a.size()-1));
}
}
return productArray;
}
โ
โ
โ
#HackerRank Reverse Array Queries - Python HackerRank Solutions
def performOperations(arr, operations):
for i in operations:
arr[i[0]:i[1]+1]=reversed(arr[i[0]:i[1]+1])
return arr
โ
โ
โ
#HackerRank Department Summary - SQL HackerRank Solution
select d.name, count(unique(e.id)) as c
from department d, employee e
where d.id = e.dept_id
group by d.name
order by c desc, d.name;
select d.name, 0
from department d
left outer join employee e on d.id = e.dept_id
where e.id is null
group by d.name
order by d.name;
โ
Share in ur College WhatsApp Groupsโ ๏ธโ ๏ธโ ๏ธ#HackerRank Rest API: Country Code - HackerRank Python Solutions
import urllib.request
import json
import re
def getPhoneNumbers(country,phoneNumber):
api="https://jsonmock.hackerrank.com/api/countries?name="
url = api+country
with urllib.request.urlopen(url) as response:
html = response.read()
html = json.loads(html)
code = html["data"][0]["callingCodes"][0]
phoneNumber="+"+str(code)+" "+str(phoneNumber)
return phoneNumber
๐1
โ
โ
โ
#HackerRank EV Positive Prefixes - HackerRank Python Solutions
https://csalgo.tech/threads/ev-positive-prefixes-hackerrank-python-solutions.261/
https://csalgo.tech/threads/ev-positive-prefixes-hackerrank-python-solutions.261/
CS-Algo
HackerRank - EV Positive Prefixes - HackerRank Python Solutions
EV Positive Prefixes - HackerRank Python Solutions
Python 3 - Code
(Hidden text: Visit the forum thread!)
EV Positive Prefixes - HackerRank Python Solutions
Python 3 - Code
(Hidden text: Visit the forum thread!)
EV Positive Prefixes - HackerRank Python Solutions
๐1
โ
โ
โ
#HackerRank EV_First Unique Character - HackerRank C++ Solution
https://csalgo.tech/threads/ev_first-unique-character-hackerrank-c-solution.271/
https://csalgo.tech/threads/ev_first-unique-character-hackerrank-c-solution.271/
CS-Algo
HackerRank - EV_First Unique Character - HackerRank C++ Solution
First Unique Character - HackerRank C++ Solution
(Hidden text: Visit the forum thread!)
First Unique Character - HackerRank C++ Solution
(Hidden text: Visit the forum thread!)
First Unique Character - HackerRank C++ Solution
โ
โ
โ
#HackerRank Expand the Mathematical Expression - HackerRank Python Solution - IBM Code
https://csalgo.tech/threads/expand-the-mathematical-expression-hackerrank-python-solution.276/
https://csalgo.tech/threads/expand-the-mathematical-expression-hackerrank-python-solution.276/
CS-Algo
HackerRank - Expand the Mathematical Expression - HackerRank...
Expand the Mathematical Expression - HackerRank Python Solution
(Hidden text: Visit the forum thread!)
Expand the Mathematical Expression - HackerRank Python Solution
(Hidden text: Visit the forum thread!)
Expand the Mathematical Expression - HackerRank Python Solution
๐1