digiutils

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 6, 2023 License: MIT Imports: 4 Imported by: 1

README

Digiutils

A collection of tools that help you solve daily problems.

Go

This collection is intended to document 📝 what I already solved from the coding challenge platform either from leetcode, hackerrank, codewars, etc, and also one form of #100DaysOfCode movement 🏃‍♂️. If you find it useful please give it a star ⭐ or even do your contribution. Cheers 🥂

Installation

go get github.com/Digisata/digiutils

Usage

This is the basic usage, just import the library and you are ready to go.

package main

import (
 "fmt"
 "github.com/Digisata/digiutils"
)

func main() {
 fmt.Println(digiutils.AddBinary("11", "1")) // 100
}

Meta

Hanif Naufal – @Digisatahnaufal123@gmail.com

Distributed under the MIT license. See LICENSE for more information.

Contributing

  1. Fork this repository.
  2. Create your own branch (git checkout -b fooBar).
  3. Commit your changes (git commit -am 'Add some fooBar').
  4. Push to the branch (git push origin feature/fooBar).
  5. Create your awesome Pull Request.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBinary

func AddBinary(a, b string) string

AddBinary takes two parameters a and b and returns their sum as a binary string.

func ContainsDuplicate

func ContainsDuplicate(nums []int) bool

ContainsDuplicate finds an unduplicated number, if there is no duplication it will return false.

func IsPalindrome

func IsPalindrome(s string) bool

IsPalindrome checks whether s is a palindrome or not after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters.

func IsPowerOfTwo

func IsPowerOfTwo(n int) bool

IsPowerOfTwo returns true if n is a power of two. Otherwise, return false.

func RomanToInt

func RomanToInt(s string) (res int)

RomanToInt convert roman numeral to int, it returns 0 if s is not a valid roman numeral.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL