Dan is playing a video game in which his character competes in The Hurdle Race. Hurdles are of varying heights, and Dan has a maximum height he can jump. There is a magic potion he can take that will increase his maximum height by 1 unit for each dose. How many doses of the potion must he take to be able to jump all of the hurdles? Given an array of hurdle heights h, and an initial maximum height Dan …

Home » Archives for hasectic

# Author: hasectic

→A web developer(Front end and Back end), and DBA at csdamu.com.
Currently working as Salesforce Developer @ Tech Matrix IT Consulting Private Limited. Check me @about.me/s.saifi

We define a magic square to be a matrix of distinct positive integers from 1 to n2 where the sum of any row, column, or diagonal of length n is always equal to the same number: the magic constant.You will be given a 3 X 3 matrix s of integers in the inclusive range [1,9]. We can convert any digit a to any other digit b in the range [1,9] at cost of |a-b|. For this Problem Forming a Magic Square Given s, convert it into a magic square at minimal cost. Print this cost on a new line.Note: The …

Alexa has two stacks of non-negative integers, stack A=[a0,a1,…….am-1] and stack B=[b0,b1,…………bn-1] where index 0 denotes the top of the stack. Alexa challenges Nick to play the following game Game of Two Stacks Hackerrank : In each move, Nick can remove one integer from the top of either stack A or stack B. Nick keeps a running sum of the integers he removes from the two stacks. Nick is disqualified from the game if, at any point, his running sum becomes greater than some integer x given at the beginning …

Ice Cream Parlor Hackerrank Each time Sunny and Johnny take a trip to the Ice Cream Parlor, they pool together m dollars for ice cream. On any given day, the parlor offers a line of n flavors. Each flavor, i, is numbered sequentially with a unique ID number from 1 to n and has a cost, ci, associated with it. Given the value of m and the cost of each flavor for t trips to the Ice Cream Parlor, help …

In the Previous Post, we have learned about Webservice and Callout using REST and SOAP API for Salesforce . Continue with that we are giving you one example using REST API. REST API First Example First of all, we will learn how to get an address from Google API if we will pass latitude and longitude using APEX callout. First of all please check the code below you can execute it into your org anonymous window of developer console. Http …

If you want to connect two devices or software over a network (world wide web), then you will need some web service that will help you to connect them.There are two popular services that is used for Webservice and Callout that is: SOAP(simple object access protocol.) REST (Representational state transition) Webservice and Callout for any API the structure looks like the following. REST API URL anyone or multiple of the following in header Access token username, password certificate content-type Method …

If you want to send email to your sales team every morning, or do you want to check the attedance of all your employee in company, how apex will help in salesforce.we will need something. Batch Class and Scheduler Apex Scheduler is used to schedule a class or bunch of task at the specific time for once or at regular interval. Batch class is the class that will be scheduled, it is a special type of class for bulk records. …