HackeRank | Hackerank Programming Challenges | Learning library
kandi X-RAY | HackeRank Summary
kandi X-RAY | HackeRank Summary
Hackerank Programming Challenges
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Return the maximum number of hourglasses in an array
- Calculate the sum of the hour of an hour
- Find the minimum value of an array
- Compares two triplets
- Sum the elements in an array
- Return the power of n
- Wier function
- Return the factorial of n
- Display the node
- Calculate the divisor sum
- Reverse a list
- This function is used for testing
- Computes the difference between each element in the list
- Get the min and max values for a given range
- Remove duplicates from head
- Generate a binary number
- Pretty print the tree
- Insert node into head
- Return the height of the tree
- Determine the score
- Returns the min and max values of a list
HackeRank Key Features
HackeRank Examples and Code Snippets
Community Discussions
Trending Discussions on HackeRank
QUESTION
I was attending a question in hackerank advanced SQL certification, i came across a question like to find the maximum, minimum and average of temperature . i wrote query evrrything was perfect except Average
Below is my query
...ANSWER
Answered 2022-Mar-22 at 10:24Just use the average function AVG()
here:
QUESTION
When solving the set questions of Hackerank, I got this doubt. When I ran the first snippet, I got the type as a list, Which is correct because of the outside braces([]).
...ANSWER
Answered 2021-Jul-25 at 05:40in the second code, this is list unpacking. For example:
QUESTION
set serveroutput on;
DECLARE
I NUMBER;
J NUMBER;
BEGIN
FOR I IN REVERSE 1..20
LOOP
FOR J IN 1..I
LOOP
DBMS_OUTPUT.PUT('* ') ; -- printing *
END LOOP;
DBMS_OUTPUT.NEW_LINE; -- for new line
END LOOP;
END;
...ANSWER
Answered 2021-Mar-21 at 10:40That site doesn't seem to ever show your the output from your submission, unhelpfully, but does with just 'run code'. Surprisingly it does seem to understand PL/SQL; and even more surprisingly it handles the set serveroutput on
, which is a SQL\Plus/SQL Developer client command.
But you need to add a terminating /
after your code, on a line on its own - again, just like SQL*Plus (though SQL Developer is sometimes doesn't complain):
QUESTION
In response to the Hackerank problem: https://www.hackerrank.com/challenges/ctci-making-anagrams/problem where one must find the number, as an integer, of characters to be removed from a string to make it an anagram of another string.
I have completed the code and the program passes the tests but I am wanting help with increasing its efficiency. How do I go about thinking how to improve the efficiency of the following code?
...ANSWER
Answered 2020-Apr-29 at 11:39First rule of optimization: Avoid unnecessary operations:
- Like calling to
contains
before callingadd
.
Second rule of optimization: If you want it faster, you'd better lean on memory:
- Do not call the same function several times with the same input values: Better call only once, store the value in a local variable, and use it afterwards.
- Also, computing the number of occurrences of a character in a string is not efficient (the longer the strings, the least efficient): Better create a map for each string, mapping each character to a number of occurrences.
- Dave's suggestion about how to optimize such maps is interesting, too.
QUESTION
I am trying to look for a correspond value to the key in dictionary on Hackerank.
I tried to print out every process to debug, and I found the process ran quite as I expected, however, the result was really weird. my output shows that the statement did read the right name "harry", but it cannot find "harry" in my dictionary. Can someone pls give me some ideas on this, thank you!
Here are my codes:
...ANSWER
Answered 2020-Apr-11 at 14:17thats happen cuz u put break
in ur else statement. So, the code will break at the first loop, and can't get the next items in d
. So, u have to erase break in else statement.
But we have new problem, in every loop there will execute the else statement if search_phone != name
. So, we have solve this. U can try this one(sorry for bad english)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install HackeRank
You can use HackeRank like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page