This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solveHanoi(blockNumber, rodFrom, middleRod,rodTo): | |
if(blockNumber==1): | |
print("Plate {0} from {1} to {2}".format(blockNumber,rodFrom,rodTo)); | |
return; | |
solveHanoi(blockNumber-1, rodFrom,rodTo,middleRod); | |
print("outside: Plate {0} from {1} to {2}".format(blockNumber,rodFrom,rodTo)); | |
solveHanoi(blockNumber-1, middleRod,rodFrom ,rodTo); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solution(A, K): | |
outputArray=[0]*len(A); | |
for index in range(len(A)): | |
outputIndex=(index+K)%len(A); | |
outputArray[outputIndex]=A[index]; | |
return outputArray; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def solution(N): | |
# write your code in Python 3.6 | |
binaryNumber=bin(N); | |
binaryGap=0; | |
data=str(binaryNumber); | |
finalList=[]; | |
dataList=[]; | |
#print(data); | |
for index in range(len(data)): | |
if(data[index]=="1" and "1" in dataList and "0" in dataList): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global type gf_resize from function_object | |
end type | |
forward prototypes | |
global function integer gf_resize (any variable_array, any constant_array) | |
end prototypes | |
global function integer gf_resize (any variable_array, any constant_array);/* | |
NAME:smaina | |
ISSUE:ZMES-317 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global type gr_resize_objects from function_object | |
end type | |
forward prototypes | |
global function integer gr_resize_objects (any str_array_objects, integer workspace_width, integer workspace_height) | |
end prototypes | |
global function integer gr_resize_objects (any str_array_objects, integer workspace_width, integer workspace_height); | |
str_resize_objects objects [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str_constant constants [] | |
st_variable resizables [] | |
constants =constant_array | |
resizables = variable_array | |
integer index_c,index_r | |
/* | |
used to get all the graphical objects that are to remain at a relative similar position | |
as before resizing | |
*/ | |
for index_c=1 to UpperBound(constants) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private boolean deleteIndex(String indexName, String typeName, String id) { | |
if (isIndexExist(indexName)) { | |
System.out.println("INDEX EXISTS>>>DELETE INDEX"); | |
return NodeOperation.INSTANCE.getClient().prepareDelete(indexName, typeName, id).execute().actionGet() | |
.isFound(); | |
} else { | |
return false; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var compare=function(user,comp){ | |
if(user===comp){ | |
return "The result is a tie!"; | |
}else if(user==="rock"){ | |
if(comp==="scissors"){ | |
return "rock wins"; | |
}else{ | |
return "paper wins"; | |
} | |
}else if(user==="paper"){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Check if the user is ready to play! | |
confirm("Are you ready to play?"); | |
var age=prompt("What is your age"); | |
if(age<13){ | |
console.log("You can play this game but the developers take no responsibility for your actions ") | |
}else{ | |
console.log("Welcome"); | |
} | |
console.log("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Set; | |
import java.util.HashSet; | |
class Solution { | |
public int solution(int[] A) { | |
// write your code in Java SE 8 | |
Set<Integer> abs=new HashSet<Integer>(); | |
for(int index=0;index<A.length;index++){ | |
abs.add( Math.abs(A[index])); | |
} | |
return abs.size(); |
NewerOlder