Skip to content

hrz8/lets-go-seeds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lets-go-bibit

What's going on here?

01_Simple-Database-Query

# Create Users Table
CREATE TABLE Users (
  ID  int NOT NULL PRIMARY KEY AUTO_INCREMENT,
  UserName nvarchar(255) NOT NULL,
  Parent int NULL
);
ALTER TABLE Users ADD FOREIGN KEY (Parent) REFERENCES Users (ID);

# Query for Select User and ParentName
SELECT
  child.ID,
  child.UserName,
  COALESCE(parent.UserName, NULL) as 'ParentName'
FROM Users child
  LEFT JOIN Users parent ON (child.Parent = parent.ID);

02_OMDB-API

Movies Microservices Task

Repository: https://github.com/hrz8/go-seeding-omdb

03_Refactor

Refactor the function

func FindFirstStringInBracket(str string) string {
	indexFirstBracketFound := strings.Index(str, "(")
	if len(str) == 0 || indexFirstBracketFound < 0 {
		return ""
	}
	strRunes := []rune(str)
	wordsAfterFirstBracket := string(strRunes[indexFirstBracketFound:len(str)])
	indexClosingBracketFound := strings.Index(wordsAfterFirstBracket, ")")
	if indexClosingBracketFound < 0 {
		return ""
	}
	afterBracketRunes := []rune(wordsAfterFirstBracket)
	return strings.Split(string(afterBracketRunes[1:indexClosingBracketFound]), " ")[0]
}

Play the Game

[lets-go-bibit]$ cd 03_Refactor/
[04_Logic]$ go test *.go

04_Logic

Write a function to grouping list of string given based on anagram.

Play the Game

[lets-go-bibit]$ cd 04_Logic/
[04_Logic]$ go run main.go

Releases

No releases published

Packages

No packages published

Languages