Skip to content

Instantly share code, notes, and snippets.

View KarenWest's full-sized avatar

Karen West KarenWest

View GitHub Profile
"""
I was given the following puzzle to solve to obtain an interview, and not that I received notice yesterday that I was not selected (could not get the puzzle to perform that well), I was wondering if anyone out there may know how to help me solve this to perform better. It was written in Python, and although I had 2 classes in Python a year or two ago, I'm still new to it compared to the world I used to work in (18 years of embedded C!) Any help or advice so that I may learn from the experience appreciated. Puzzle problem submission for consideration of being selected for an interview there.
Puzzle Challenge Description Given:
Consider a "word" as any sequence of capital letters A-Z (not limited to just "dictionary words"). For any word with at least two different letters, there are other words composed of the same letters but in a different order (for instance, STATIONARILY/ANTIROYALIST, which happen to both be dictionary words; for our purposes "AAIILNORSTTY" is also a "word" composed of the same let
@KarenWest
KarenWest / gist:5195284
Created March 19, 2013 11:06
trying gist - Sam told me about - A better way of sharing error message posts.
I see I did (first time around exploring the SaaS1 class) create a github account
but have not used it really yet.
@KarenWest
KarenWest / gist:5195286
Created March 19, 2013 11:06
trying gist - Sam told me about - A better way of sharing error message posts.
I see I did (first time around exploring the SaaS1 class) create a github account
but have not used it really yet.
@KarenWest
KarenWest / gist:5195304
Created March 19, 2013 11:11
trying gist - Sam told me about - A better way of sharing error message posts.
I see I did (first time around exploring the SaaS1 class) create a github account
but have not used it really yet.
@KarenWest
KarenWest / gist:5195342
Created March 19, 2013 11:18
trying gist again - logged into github this time
Will the URL work this time?
@KarenWest
KarenWest / gist:5195432
Created March 19, 2013 11:37
new attempt at logged in gist post
Let me know if you can see this - also - how do I see that you responded
or commented on these - you said you commented earlier on the not-logged-in
post of a gist whose URL worked for me.
@KarenWest
KarenWest / gist:5195611
Created March 19, 2013 12:13
AI Class Homework #2 Question #1 - questions about problems I got incorrect
Here is my first question on Homework #2 Problem #1 and I did the worst on question #1 (where I got the most parts incorrect).
Part 1: Unary Constraints:
My incorrect answer was: (i), (iii), (iv), (v), (vi)
Domains after unary constraints:
A: (1,1), (1,3), (2,2), (2,3)
B: (1,3), (2,3)
C: (1,1), (1,2), (1,3), (2,1), (2,2)
D: (1,2), (2,1)
My code for 169.1 (take 2) homework #1 question #2 (RPS game) is below along with the testing output.
I realize that you should take any nested level of an RPS game, but I started out simply here, not yet
knowing how to do any nesting level, so that would be my first question.
But given my code below and the test cases I gave it, the specific 8 player given in the description,
along with the 16 player, this works fine for me. Yet it fails the autograder, so this simplified version
that does not allow any nesting level is my first question.
I'm new to Ruby and have mostly been writing in Python and before that C, so new to this syntax,
In this 169.1 homework #1 question #3, I can see that I find the anagrams correctly and put them in a list,
but it is not in the correct form for the expected output. I am guessing here that my ignorance with Ruby
is causing me trouble here again?
=begin
Karen West, April 8th, 2013
HW 1-3: Anagrams
An anagram is a word obtained by rearranging the letters of another word. For example, "rats", "tars", and "star" are anagrams of one another, as are "dictionary" and "indicatory". We will call any array of single-word anagrams an anagram group. For instance, ["rats", "tars", "star"] is an anagram group, as is ["dictionary"].
For 169.1 saas homework #1 question #4, I have not yet read in the book about this which is what I plan to do later today.
So that may help me here. For this question, it passes 4 of the 6 autograder tests.
=begin
Karen West, Homework #1, part 4, SaaS1, April 8th, 2013
HW 1-4: Basic Object Oriented Programming
Part A: Create a class Dessert with getters and setters for name and calories. Define instance methods healthy?, which returns true if a dessert has less than 200 calories, and delicious? which returns true for all desserts.
Here is the framework: