dark orange"]
-- getAllContains "muted yellow" list==> ["light red", "dark orange"]
-- getAllContains "light red" list   ==> []
-- getAllContains "dark orange" list ==> []

-- input :: [[Char]]
-- input = ["light red bags contain 1 bright white bag, 2 muted yellow bags.","dark orange bags contain 3 bright white bags, 4 muted yellow bags.","bright white bags contain 1 shiny gold bag.","muted yellow bags contain 2 shiny gold bags, 9 faded blue bags.","shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags.","dark olive bags contain 3 faded blue bags, 4 dotted black bags.","vibrant plum bags contain 5 faded blue bags, 6 dotted black bags.","faded blue bags contain no other bags.","dotted black bags contain no other bags."]

-- inputList :: [[Char]] -> [(String, String)]
-- inputList = fmap prepareInput

-- prepareInput :: [Char] -> (String, String)
-- prepareInput line = (pair, colours)
--     where
--         pair = unwords $ init $ takeWhile (/= "contain") $ words line
--         colours = unwords $ tail $ dropWhile (/= "contain") $ words line

-- list :: [([Char], [Char])]
-- list = [
--     ("light red", "1 bright white bag, 2 muted yellow bags."),
--     ("dark orange", "3 bright white bags, 4 muted yellow bags."),
--     ("bright white", "1 shiny gold bag."),
--     ("muted yellow", "2 shiny gold bags, 9 faded blue bags."),
--     ("shiny gold", "1 dark olive bag, 2 vibrant plum bags."),
--     ("dark olive", "3 faded blue bags, 4 dotted black bags."),
--     ("vibrant plum", "5 faded blue bags, 6 dotted black bags."),
--     ("faded blue", "no other bags."),
--     ("dotted black", "no other bags.")
--     ]
  
-- -- getAllContains :: String -> [(String, String)] -> [String]
-- getAllContains :: [Char] -> [(a, String)] -> [a]
-- getAllContains adjectcolour c = map fst $
--   filter
--     ( \l ->
--         let w = words (snd l)
--             ac = words adjectcolour
--             adject = head ac
--             colour = ac!! 1
--          in elem adject w && elem colour w
--     ) c

-- program :: [Char] -> [([Char], String)] -> [[[Char]]]
-- program start ls = fmap (`getAllContains` ls) asdf ++ [asdf]
--   where
--     asdf = getAllContains start ls

-- count :: [[Char]] -> [[Char]]
-- count i = nub $ concat $ program "shiny gold" (inputList i)

-- answer :: [[Char]] -> Int
-- answer i = length $ count i


-- -- |
-- -- >>> extract
-- -- 4
-- extract :: IO Int
-- extract = do
--   inp <- readFile "src/year2020/Day7/example.txt"
--   pure $ answer $ lines inp


-- -- |
-- -- >>> extract2
-- -- 93
-- extract2 :: IO Int
-- extract2 = do
--   inp <- readFile "src/year2020/Day7/input.txt"
--   pure $ answer $ lines inp

-----------------
When people search for products and services, it’s obvious why we want to be high in search engine results and preferably on the first page. That’s because research proves, that people don’t drill down past the first page of search term results.
But more than that, there’s certain amount of prestige and value in appearing prominently in search results for terms related to your business.
Search engine optimization, often abbreviated as SEO, refers to a set of processes by which a website is improved (optimized) in order to rank better in searches using Keyword Search Terms.
Having a great looking website is useless if it’s not discoverable or seen by any one.
Being seen if Vital and it doesn’t just happen.
SEO is all about getting your website exposed - and about how many times your website is visible under one or more search terms.
Like any PR campaign – your message is only as loud as the number of people who see it. With SEO its the methodical step by step process to identify what you want to achieve, and making sure you have the processes in place to achieve these results.
If your business depends on customer patronage and operates in a competitive environment… absolutely, you should care!
Hotels for example, know that travelers use the Internet and the search engines to collect information about travel and about the accommodation possibilities available to them. Next, competition and competitor offerings mean that the hotel must work doubly hard to ensure they’re seen amongst the wave of similar listings. Moreover competition can be our direct competitors, our agents, other generic alternatives and even alternative holiday destinations - adding to the mix.
With this in mind – and remembering that most people use the Internet to gather information, as well to facilitate and reinforce their final purchase decision, achieving and maintaining good search term (page) ranking under one or more search terms, is important.
Search engines use very specific algorithms to decide how they display results.
Supposing they chose to show people things they didn’t want to see – its obvious people wouldn’t use them. (That’s one reason why Google is more popular then Bing) Poor user experiences or irrelevant content can make users doubt the validity of results. Over time it could erode the user’s confidence in the search engine.
That’s why search engines place importance on the quality of your website and its contents (if you don’t care why should they).
1. The search engines can find you.
2. They can easily tell their visitors what your web pages are about.
3. They believe your page/site has authority and credibility for the content you’re promoting.
Part of the SEO process, involves identifying which keywords and phrases your target audience uses when looking for products or services like yours, then working towards ranking well for those searches.
SEO is like a tree with many branches.
Components of SEO include a multitude of various practices mainly to do with 1. On-Site and 2. Off-Site dynamics, specifically designed to target search engines in their crawling and indexing process.
A. “ONSITE” Strategy : Optimization Dynamics and On-site Manipulation.
1. Choose the Right Keywords and Phrases : Think for a moment about how you would expect potential guests to find your hotel online. What words and phrases would you expect them to type into the search engine to locate you? Then - look at your website... Do these same words and phrases appear at least once on your site?
A crucial component of SEO is using the right keywords', or a combination of words and phrases that people are actually use to find websites like yours.
2. Preparing Quality Content : You need unique and high-quality content that’s relevant and different from content on other sites in both wording and topics. This gives a real boost for your site’s online presence. It’s better to have longer, more meaningful pieces of 450 words or more.
3. Meta Tags : Title and Description : The invisible information behind every webpage is the unique meta title and meta description code in HTML language. The coding is language speak for search engine to tell their visitors what your page is about.
4. URL (Universal Resource Locator) : Having your keywords in URLs will help a lot towards SEO. If, for example, the keyword you want to rank for is “budget hotel rooms”, you should include that in your URL — http:// yourhotel.com/budget-hotel-rooms. Remember though, if you don’t have the keywords in other part of the page, you can’t rely on simply having them in the URL.
5. Images: While search engines can’t read images, (yet) they can read the descriptions in the image file name and tags. You should include keywords in both of these, but they need to accurately describe what the image is (whether it’s a lobby, guest room, or banner ad).
6. Linking Internally : Internal links help users navigate and help establish importance to search engines by the number and quality of links to a given page. These are generally keywords or phrases that are linked from one page to another within your website.
Offsite / page SEO, is about building up your website’s online authority through inbound links from other websites. Off-site SEO is all about the quality and relevance of the links to your website (websites with lots of quality user traffic), which establishes your own authority and determines your search ranking results.
Links from external websites is the one of main ways search engines evaluate and rank your website. Link building is where you get other sites (preferable with high page ranks and domain authority) to point towards your website.
Quality — the popularity of the page that links to you.
Authority — the trustworthiness of the domain pointing to you.
Quantity — the more high-quality, trustworthy pages that link to you, the better.
D