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
# Sum of unique elements | |
# from collections import Counter | |
# def getCount(myArray): | |
# count=0 | |
# unique_elements_array=[] | |
# myCounter=Counter(myArray) | |
# for i in myCounter: | |
# if myCounter[i]==1: | |
# unique_elements_array.append(i) | |
# count+=1 |
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
<form method='POST' action="{% url 'homeview' %}"> | |
{% csrf_token %} | |
<input type="submit" value="OK"> | |
</form> |
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
#https://www.hackerrank.com/challenges/new-year-chaos/problem | |
def minimumBribes(q): | |
count=0 | |
q=[p-1 for p in q] | |
for i in reversed(q): | |
ind=q.index(i) | |
if ind>i: | |
temp=ind-i | |
print(temp) | |
if temp>2: |
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 function(request): | |
def sub_function(request): | |
return render(request, 'link.html', {}) | |
return render(request, 'link2.html', {}) |
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
<form method = "POST" action="resultat.html"> {% csrf_token %} | |
{{ form }} | |
<input type = "submit" value = "Submit"> | |
</form> | |