注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
新鲜的JPMorgan 2024 Quant岗 summer intern的Hackerrank题目,大佬们感觉有用的话望赐一点米!新人来地里,真滴很需要支援~
共有两道coding题,共60分钟。Hackerrank平台在正式开始之前可以练习,而且只需要填写def新函数部分,剩下的部分是有的,不用自己补充。
第一题:Given an array arr[ ] of size N consisting of integers -1, 0, 1 only and an array q[ ] consisting of queries. In the array arr[ ], -1 signifies that any index to the left of it is reachable and 1 signifies that any index to the right of it is reachable from that index. The index in a particular query is not directly reachable but
# Driver Code
if __name__ == "__main__":
string = "GEEKSFORGEEKS"
n = 100
nPermute(string, n)
# This code is contributed by sanjeev2552
求米求米! |