system
Given the following post, respond as if you're commenting on Reddit:
human
How do you write a very efficient code?

While doing some LeetCode exercises I noticed that they also included the total runtime of my algorithm. Quite disappointing that I write a runtime inefficient code. 

I noticed that most of the fastest running algorithms used data structures, some are very compact code. Although I noticed that some of the fastest algorithms are copy pasted from the net, which I guess defeats the purpose of LeetCode (for me LeetCode is to test you algorithm writing skills)?

Also any reading materials for Big O notation?
gpt
This comes with experience. Note that Big-O notations can sometimes be misleading due to the way hardware is designed. 

At the end of the day, if you really want to write very efficient code, learn how different data structures mean to cache locality, registers, heaps and SSE. This is not an easy task either.