Skip to content

Instantly share code, notes, and snippets.

View pattu777's full-sized avatar
💭
Learning..

Chinmaya Kr. Patanaik pattu777

💭
Learning..
View GitHub Profile
@pattu777
pattu777 / task.py
Created August 10, 2016 12:11
Search a string from a list of strings using a Trie.
"""
Lets say you have an array with a list of sub strings. Write a function that takes an input string and return true if the string can be divided into substrings contained in the array.
Example: array: [‘and’, ‘the’, ‘back’, ‘front’, ‘ory’ , ‘end’, ‘po’ , ‘pu’, ‘lar’]
function subDivideString(inputString):
if inputString ==’backend’ return true since array has ‘back’ , ‘end’
if inputString == ‘popular’ return true since array has ‘po’ , ‘pu’, ‘lar’
if inputString == ‘backwards’ return false since array doesnt have ‘wards’
if inputString == ‘swapan’ return false since array doesnt have any part of the word.
@pattu777
pattu777 / sample.yml
Created September 16, 2013 11:42
delete ec2 instances, ebs volumes and security groups via ansible playbooks.
Hi,
I have just started learning ansible. I have written a simple playbook which will create , delete a server using ansible's ec2 module. I can also create a volume and attach it to a previously created instance.
---
- name: Sample playbook for Amazon AWS ec2 management via ansible
hosts: local
connection: local
vars:
aws_access_key: xxxx